Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bugfix: Allow non-empty concrete lists
We used to report an error if we had a concrete list like '[1]' and it should have type 'nonempty_list()'. Why? Because the list is represented as a cons followed by a nil, and we require the tail of the cons to have the same type as the whole cons. But this patch weakens the demand on the type of the tail of the cons so that it is always allowed to be the empty list.
- Loading branch information
Showing
2 changed files
with
17 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
-module(nonempty_cons). | ||
|
||
-spec t() -> [integer(), ...]. | ||
t() -> | ||
[1]. |