typer since R12B-2 cannot annotate multiple files

Paul Hampson PaulH@REDACTED
Fri Nov 20 07:58:49 CET 2009


There's a bug in typer in R13B02-1, introduced in a refactoring in OTP R12B-2 which causes it to fail to annotate multiple files in one pass. (eg. with --annotate -r src/)

In effect, typer_annotator:write_typed_file/2 (line 285 in the 13.b.2.1 Debian package) assumes that because the TyperAnnDir exists, the file in it called NewFileName exists and so calls

ok = file:delete(NewFileName),

and suffers a badmatch against { error, enoent } if that file does not exist, which happens when you try to annotate multiple files, for the second file in that directory.

Prior to R12B-2, this code was in typer_generator.erl and didn't match the return value of file:delete at all.

As a workaround, precreating the typer_ann directory and touching the appropriate .ann.erl files causes typer to work fine, as far as I can tell.

-- 
Paul "TBBle" Hampson
Project: Find out what makes things tick
Plan: Stop the ticking...


More information about the erlang-bugs mailing list