Skip to content

Commit fd1c12f

Browse files
committed
Fix typespec for Macro.struct!/2
1 parent 709383f commit fd1c12f

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

lib/elixir/lib/macro.ex

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -661,7 +661,9 @@ defmodule Macro do
661661
dependency on the given struct.
662662
"""
663663
@doc since: "1.8.0"
664-
@spec struct!(module, Macro.Env.t()) :: %{__struct__: module} when module: module()
664+
@spec struct!(module, Macro.Env.t()) ::
665+
%{required(:__struct__) => module, optional(atom) => any}
666+
when module: module()
665667
def struct!(module, env) when is_atom(module) do
666668
if module == env.module do
667669
Module.get_attribute(module, :__struct__)

0 commit comments

Comments
 (0)