<div dir="ltr">Hi all,<div>I'm having a hard time figuring out why the following code won't compile:</div><div><br></div><div><div><div><div>-module(t).</div><div><br></div><div>-export([test/1]).</div><div><br></div><div>-record(map, {a, b}).</div><div>-type map() :: #map{}.</div><div><br></div><div>-record(tuple, {a, b}).</div><div>-type tuple() :: #tuple{}.</div><div><br></div><div>-record(list, {a, b}).</div><div>-type list() :: #list{}.</div><div><br></div><div>-spec test(map() | tuple() | list()) -> map | tuple | list.</div><div>test(#map{}) -> map;</div><div>test(#tuple{}) -> tuple;</div><div>test(#list{}) -> list.</div></div></div></div><div><br></div><div>erlc t.erl:<br></div><div>   t.erl:9: type tuple() already defined<br></div><div><br></div><div>why should the tuple() type throw an error when the others do not?</div></div>