Skip to content

Commit

Permalink
Raise on unsupported literal lists
Browse files Browse the repository at this point in the history
  • Loading branch information
Qqwy committed Oct 1, 2021
1 parent fd3fc7c commit 4b251d6
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/type_check/internals/pre_expander.ex
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,15 @@ defmodule TypeCheck.Internals.PreExpander do
quote generated: true, location: :keep do
TypeCheck.Builtin.nonempty_list(unquote(rewritten_element_type))
end
other ->
raise """
TypeCheck does not support the list literal `#{Macro.to_string(other)}`
Currently supported are:
- [] -> empty list
- [type] -> list(type)
- [...] -> nonempty_list()
- [type, ...] -> nonempty_list(type)
"""
end
# rewritten_values =
# list
Expand Down

0 comments on commit 4b251d6

Please sign in to comment.