Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1548 from darth-tytus/typeErrorDiagnostic
Better errors for type mismatches #1532
- Loading branch information
Showing
11 changed files
with
187 additions
and
59 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
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
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 |
---|---|---|
@@ -1,19 +1,37 @@ | ||
Error: Atoms argument type is not a subtype of its declared type in file extended_subtypes3.dl at line 20 | ||
Error: Atom's argument type is not a subtype of its declared type in file extended_subtypes3.dl at line 20 | ||
SymbolChain(a, a, a) :- SymbolChain(a, _, _). | ||
---------------^------------------------------ | ||
Error: Atoms argument type is not a subtype of its declared type in file extended_subtypes3.dl at line 20 | ||
The argument's declared type is symbolB in file extended_subtypes3.dl at line 18 | ||
.decl SymbolChain(a: symbolA, b: symbolB, c: symbolC) | ||
---------------------------------^-------------------- | ||
Error: Atom's argument type is not a subtype of its declared type in file extended_subtypes3.dl at line 20 | ||
SymbolChain(a, a, a) :- SymbolChain(a, _, _). | ||
------------------^--------------------------- | ||
Error: Atoms argument type is not a subtype of its declared type in file extended_subtypes3.dl at line 21 | ||
The argument's declared type is symbolC in file extended_subtypes3.dl at line 18 | ||
.decl SymbolChain(a: symbolA, b: symbolB, c: symbolC) | ||
---------------------------------------------^-------- | ||
Error: Atom's argument type is not a subtype of its declared type in file extended_subtypes3.dl at line 21 | ||
SymbolChain(b, b, b) :- SymbolChain(_, b, _). | ||
------------------^--------------------------- | ||
Error: Atoms argument type is not a subtype of its declared type in file extended_subtypes3.dl at line 33 | ||
The argument's declared type is symbolC in file extended_subtypes3.dl at line 18 | ||
.decl SymbolChain(a: symbolA, b: symbolB, c: symbolC) | ||
---------------------------------------------^-------- | ||
Error: Atom's argument type is not a subtype of its declared type in file extended_subtypes3.dl at line 33 | ||
RecordSubtypes(x, [1, x], x) :- RecordSubtypes(x, _, _). // error in [1, x] and x | ||
--------------------------^------------------------------------------------------- | ||
Error: Atoms argument type is not a subtype of its declared type in file extended_subtypes3.dl at line 34 | ||
The argument's declared type is S2List in file extended_subtypes3.dl at line 31 | ||
.decl RecordSubtypes(a: List, b: S1List, c: S2List) | ||
--------------------------------------------^------- | ||
Error: Atom's argument type is not a subtype of its declared type in file extended_subtypes3.dl at line 34 | ||
RecordSubtypes(y, y, y) :- RecordSubtypes(y, _, _). // Should be error in second place and third place. | ||
------------------^------------------------------------------------------------------------------------- | ||
Error: Atoms argument type is not a subtype of its declared type in file extended_subtypes3.dl at line 34 | ||
The argument's declared type is S1List in file extended_subtypes3.dl at line 31 | ||
.decl RecordSubtypes(a: List, b: S1List, c: S2List) | ||
---------------------------------^------------------ | ||
Error: Atom's argument type is not a subtype of its declared type in file extended_subtypes3.dl at line 34 | ||
RecordSubtypes(y, y, y) :- RecordSubtypes(y, _, _). // Should be error in second place and third place. | ||
---------------------^---------------------------------------------------------------------------------- | ||
The argument's declared type is S2List in file extended_subtypes3.dl at line 31 | ||
.decl RecordSubtypes(a: List, b: S1List, c: S2List) | ||
--------------------------------------------^------- | ||
6 errors generated, evaluation aborted |
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
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 |
---|---|---|
@@ -1,10 +1,19 @@ | ||
Error: Atoms argument type is not a subtype of its declared type in file type_system12.dl at line 38 | ||
Error: Atom's argument type is not a subtype of its declared type in file type_system12.dl at line 38 | ||
C(x) :- B(x). // Error | ||
--^----------------------------------------- | ||
Error: Atoms argument type is not a subtype of its declared type in file type_system12.dl at line 39 | ||
The argument's declared type is S1 in file type_system12.dl at line 37 | ||
.decl C(x : S1) | ||
------------^--- | ||
Error: Atom's argument type is not a subtype of its declared type in file type_system12.dl at line 39 | ||
C(x) :- !A(x), B(x). // Error | ||
--^----------------------------------------- | ||
Error: Atoms argument type is not a subtype of its declared type in file type_system12.dl at line 39 | ||
The argument's declared type is S1 in file type_system12.dl at line 37 | ||
.decl C(x : S1) | ||
------------^--- | ||
Error: Atom's argument type is not a subtype of its declared type in file type_system12.dl at line 39 | ||
C(x) :- !A(x), B(x). // Error | ||
-----------^-------------------------------- | ||
The argument's declared type is S2 in file type_system12.dl at line 23 | ||
.decl A(x : S2) | ||
------------^--- | ||
3 errors generated, evaluation aborted |
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 |
---|---|---|
@@ -1,4 +1,7 @@ | ||
Error: Atoms argument type is not a subtype of its declared type in file type_system14.dl at line 24 | ||
Error: Atom's argument type is not a subtype of its declared type in file type_system14.dl at line 24 | ||
RG(val) :- RD(val), RE(cat("",val)). | ||
---^--------------------------------- | ||
The argument's declared type is B in file type_system14.dl at line 21 | ||
.decl RG(x:B) | ||
-----------^-- | ||
1 errors generated, evaluation aborted |
Oops, something went wrong.