Skip to content

Commit

Permalink
[tests] add test for new error messages
Browse files Browse the repository at this point in the history
  • Loading branch information
kLabz committed Feb 15, 2025
1 parent d465f21 commit 58bd06d
Show file tree
Hide file tree
Showing 7 changed files with 30 additions and 0 deletions.
5 changes: 5 additions & 0 deletions tests/misc/projects/Issue11164/Macro.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
class Macro {
public static function build() {
return macro :Any;
}
}
2 changes: 2 additions & 0 deletions tests/misc/projects/Issue11164/Main6.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
typedef Foo = Array<String, default>
function main() {}
5 changes: 5 additions & 0 deletions tests/misc/projects/Issue11164/Main7.hx
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
@:genericBuild(Macro.build())
private class Foo<Rest> {}
private typedef Bar = Foo<Int, default>

function main() {}
3 changes: 3 additions & 0 deletions tests/misc/projects/Issue11164/compile6-fail.hxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-main Main6
-D message.reporting=pretty
-D message.no-color
6 changes: 6 additions & 0 deletions tests/misc/projects/Issue11164/compile6-fail.hxml.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[ERROR] Main6.hx:1: characters 29-36

1 | typedef Foo = Array<String, default>
| ^^^^^^^
| Too many type parameters for Array

3 changes: 3 additions & 0 deletions tests/misc/projects/Issue11164/compile7-fail.hxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-main Main7
-D message.reporting=pretty
-D message.no-color
6 changes: 6 additions & 0 deletions tests/misc/projects/Issue11164/compile7-fail.hxml.stderr
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[ERROR] Main7.hx:3: characters 32-39

3 | private typedef Bar = Foo<Int, default>
| ^^^^^^^
| Cannot use default with rest type parameters

0 comments on commit 58bd06d

Please sign in to comment.