From 7e7a31ffafddee40a054fc2dfb204277f55771c4 Mon Sep 17 00:00:00 2001 From: Rudy Ges Date: Tue, 26 Mar 2024 09:04:37 +0100 Subject: [PATCH] Add tests for 11589 --- tests/server/src/cases/issues/Issue11589.hx | 19 +++++++++++++++++++ .../test/templates/issues/Issue11589/Main.hx | 3 +++ .../test/templates/issues/Issue11589/Main1.hx | 7 +++++++ 3 files changed, 29 insertions(+) create mode 100644 tests/server/src/cases/issues/Issue11589.hx create mode 100644 tests/server/test/templates/issues/Issue11589/Main.hx create mode 100644 tests/server/test/templates/issues/Issue11589/Main1.hx diff --git a/tests/server/src/cases/issues/Issue11589.hx b/tests/server/src/cases/issues/Issue11589.hx new file mode 100644 index 00000000000..b9cba779dec --- /dev/null +++ b/tests/server/src/cases/issues/Issue11589.hx @@ -0,0 +1,19 @@ +package cases.issues; + +class Issue11589 extends TestCase { + function test(_) { + vfs.putContent("Main.hx", getTemplate("issues/Issue11589/Main.hx")); + var args = ["--main", "Main.hx", "--no-output"]; + runHaxe(args); + runHaxe(args); + Assert.isFalse(lastResult.hasError); + } + + function testNestedField(_) { + vfs.putContent("Main.hx", getTemplate("issues/Issue11589/Main1.hx")); + var args = ["--main", "Main.hx", "--no-output"]; + runHaxe(args); + runHaxe(args); + Assert.isFalse(lastResult.hasError); + } +} diff --git a/tests/server/test/templates/issues/Issue11589/Main.hx b/tests/server/test/templates/issues/Issue11589/Main.hx new file mode 100644 index 00000000000..8ca9cd6ae2f --- /dev/null +++ b/tests/server/test/templates/issues/Issue11589/Main.hx @@ -0,0 +1,3 @@ +function main() {} + +typedef Foo = {} & { foo:T } diff --git a/tests/server/test/templates/issues/Issue11589/Main1.hx b/tests/server/test/templates/issues/Issue11589/Main1.hx new file mode 100644 index 00000000000..d0d9a178da0 --- /dev/null +++ b/tests/server/test/templates/issues/Issue11589/Main1.hx @@ -0,0 +1,7 @@ +function main() {} + +typedef Foo = { foo : { bar : T } } + +typedef Bar = { + function foo( elements : Array<{ value : T }> ) : Void; +}