[erlang-bugs] type improper_list(_,_) undefined

John Hughes <>
Mon Sep 5 16:18:22 CEST 2011


It looks as though the type improper_list/2 isn't defined in R14B02. Here's 
my file:

-module(bug).

-type ok()  :: list(float()).
-type foo() :: improper_list(float(),integer()).
-type baz() :: maybe_improper_list(float(),integer()).

Here's the output:

47> c(bug).
./bug.erl:5: type improper_list(_,_) undefined
./bug.erl:4: Warning: type ok() is unused
./bug.erl:5: Warning: type foo() is unused
./bug.erl:6: Warning: type baz() is unused
error

And here's the documentation:

List :: list(Type)                        %% Proper list ([]-terminated)
      | improper_list(Type1, Type2)       %% Type1=contents, 
Type2=termination
      | maybe_improper_list(Type1, Type2) %% Type1 and Type2 as above

Either I'm missing something very obvious, or the compiler doesn't know 
about improper_list.

John 



More information about the erlang-bugs mailing list