Browse Source

[tests] add test for new error messages

Rudy Ges 8 months ago
parent
commit
6306498e69

+ 5 - 0
tests/misc/projects/Issue11164/Macro.hx

@@ -0,0 +1,5 @@
+class Macro {
+	public static function build() {
+		return macro :Any;
+	}
+}

+ 2 - 0
tests/misc/projects/Issue11164/Main6.hx

@@ -0,0 +1,2 @@
+typedef Foo = Array<String, default>
+function main() {}

+ 5 - 0
tests/misc/projects/Issue11164/Main7.hx

@@ -0,0 +1,5 @@
+@:genericBuild(Macro.build())
+private class Foo<Rest> {}
+private typedef Bar = Foo<Int, default>
+
+function main() {}

+ 3 - 0
tests/misc/projects/Issue11164/compile6-fail.hxml

@@ -0,0 +1,3 @@
+-main Main6
+-D message.reporting=pretty
+-D message.no-color

+ 6 - 0
tests/misc/projects/Issue11164/compile6-fail.hxml.stderr

@@ -0,0 +1,6 @@
+[ERROR] Main6.hx:1: characters 29-36
+
+ 1 | typedef Foo = Array<String, default>
+   |                             ^^^^^^^
+   | Too many type parameters for Array
+

+ 3 - 0
tests/misc/projects/Issue11164/compile7-fail.hxml

@@ -0,0 +1,3 @@
+-main Main7
+-D message.reporting=pretty
+-D message.no-color

+ 6 - 0
tests/misc/projects/Issue11164/compile7-fail.hxml.stderr

@@ -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
+