diff --git a/src/protocol/tests/parser_validation.rs b/src/protocol/tests/parser_validation.rs index 14c1bb9856a7ad5c1a8fa2b9bc1ab77803786980..863a9b294fd694e58c142ac58e70bc296ebfbd55 100644 --- a/src/protocol/tests/parser_validation.rs +++ b/src/protocol/tests/parser_validation.rs @@ -350,4 +350,26 @@ fn test_incorrect_union_instance() { .assert_msg_has(1, "has been resolved to 's32'") .assert_msg_has(1, "has been resolved to 'bool'"); }); +} + +#[test] +fn test_polymorph_array_types() { + Tester::new_single_source_expect_ok( + "array of polymorph in struct", + " + struct Foo { T[] hello } + struct Bar { Foo[] world } + " + ).for_struct("Bar", |s| { s + .for_field("world", |f| { f.assert_parser_type("Foo[]"); }); + }); + + Tester::new_single_source_expect_ok( + "array of port in struct", + " + struct Bar { in[] inputs } + " + ).for_struct("Bar", |s| { s + .for_field("inputs", |f| { f.assert_parser_type("in[]"); }); + }); } \ No newline at end of file