-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Closed
Description
Elixir and Erlang/OTP versions
Erlang/OTP 27 [erts-15.1.2] [source] [64-bit] [smp:12:12] [ds:12:12:10] [async-threads:1] [jit:ns]
Elixir 1.17.3 (compiled with Erlang/OTP 27)
Operating system
Debian Linux (sid)
Current behaviour
I've been playing around with types and I made error in the @type. I added t().String instead of String.t() (from this example) and the compiler went into an infinite loop. The full code fragment is:
defmodule Foo do
@typedoc "A product"
@type product() :: t().String
end
Other observations:
t.Stringalso failsT.Stringcompilest.Stringfollowed byT.Stringfails with the following message:
== Compilation error in file lib/foo.ex ==
** (Kernel.TypespecError) lib/foo.ex:10: type product/0 is already defined in lib/foo.ex:9
(elixir 1.17.3) lib/kernel/typespec.ex:969: Kernel.Typespec.compile_error/2
(stdlib 6.1.2) lists.erl:2151: :lists.foldl_1/3
(elixir 1.17.3) lib/kernel/typespec.ex:226: Kernel.Typespec.translate_typespecs_for_module/2
Expected behaviour
The compiler should report an error.
sabiwara
Metadata
Metadata
Assignees
Labels
No labels