<div dir="ltr">Predefined types: <a href="http://www.erlang.org/doc/reference_manual/typespec.html">http://www.erlang.org/doc/reference_manual/typespec.html</a></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Dec 30, 2014 at 5:52 PM, Luis Rascão <span dir="ltr"><<a href="mailto:luis.rascao@gmail.com" target="_blank">luis.rascao@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><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>
<br>_______________________________________________<br>
erlang-questions mailing list<br>
<a href="mailto:erlang-questions@erlang.org">erlang-questions@erlang.org</a><br>
<a href="http://erlang.org/mailman/listinfo/erlang-questions" target="_blank">http://erlang.org/mailman/listinfo/erlang-questions</a><br>
<br></blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature"><div dir="ltr">Mark Nijhof<br><div><div>t: <a href="https://twitter.com/MarkNijhof" target="_blank">@MarkNijhof</a><br>s: marknijhof</div></div><div><br></div></div></div>
</div>