@@ -959,6 +959,18 @@ format_error({unsupported_option, Kind, Key}) ->
959
959
format_error ({options_are_not_keyword , Kind , Opts }) ->
960
960
io_lib :format (" invalid options for ~s , expected a keyword list, got: ~ts " ,
961
961
[Kind , 'Elixir.Macro' :to_string (Opts )]);
962
+ format_error ({undefined_function , '|' , [_ , _ ]}) ->
963
+ " misplaced operator |/2\n\n "
964
+ " The | operator is typically used between brackets as the cons operator:\n\n "
965
+ " [head | tail]\n\n "
966
+ " where head is a single element and the tail is the remaining of a list.\n "
967
+ " It is also used to update maps and structs, via the %{map | key: value} notation,\n "
968
+ " and in typespecs, such as @type and @spec, to express the union of two types" ;
969
+ format_error ({undefined_function , '::' , [_ , _ ]}) ->
970
+ " misplaced operator ::/2\n\n "
971
+ " The :: operator is typically used in bitstrings to specify types and sizes of segments:\n\n "
972
+ " <<size::32-integer, letter::utf8, rest::binary>>\n\n "
973
+ " It is also used in typespecs, such as @type and @spec, to describe inputs and outputs" ;
962
974
format_error ({undefined_function , Name , Args }) ->
963
975
io_lib :format (" undefined function ~ts /~B " , [Name , length (Args )]);
964
976
format_error ({underscored_var_repeat , Name , Kind }) ->
0 commit comments