diff --git a/src/Framework/Framework/Compilation/Parser/Binding/Parser/BindingParser.cs b/src/Framework/Framework/Compilation/Parser/Binding/Parser/BindingParser.cs index 73db32e76a..49173b122c 100644 --- a/src/Framework/Framework/Compilation/Parser/Binding/Parser/BindingParser.cs +++ b/src/Framework/Framework/Compilation/Parser/Binding/Parser/BindingParser.cs @@ -120,7 +120,11 @@ public BindingParserNode ReadPropertyDirectiveValue() public BindingParserNode ReadDirectiveTypeName() { var startIndex = CurrentIndex; - var typeName = ReadNamespaceOrTypeName(); + + var typeName = TryReadTypeReference(out var resultType) + ? resultType + : new ActualTypeReferenceBindingParserNode(new SimpleNameBindingParserNode("")); + if (PeekType() == BindingTokenType.Comma) { Read(); diff --git a/src/Tests/Parser/Binding/BindingParserTests.cs b/src/Tests/Parser/Binding/BindingParserTests.cs index 4db7414a04..04e81e9efa 100644 --- a/src/Tests/Parser/Binding/BindingParserTests.cs +++ b/src/Tests/Parser/Binding/BindingParserTests.cs @@ -829,6 +829,35 @@ public void BindingParser_GenericExpression_MemberAccessInsteadOfType_Invalid() .As().Name == ""); } + [TestMethod] + [DataRow("Domain.Company.Product.DotVVM.Feature.Type[], Domain.Company.Product")] + [DataRow("Domain.Company.Product.DotVVM.Feature.Type[], Product")] + [DataRow("Domain.Company.Product.DotVVM.Feature.Type[], Domain.Company.Product")] + [DataRow("Domain.Company.Product.DotVVM.Feature.Type[], Product")] + public void BindingParser_ArrayType_AssemblyQualifiedName_ValidAssemblyName(string binding) + { + var parser = bindingParserNodeFactory.SetupParser(binding); + var node = parser.ReadDirectiveTypeName() as AssemblyQualifiedNameBindingParserNode; + Assert.IsNotNull(node, "expected qualified name node."); + + var array = node.TypeName as ArrayTypeReferenceBindingParserNode; + + Assert.IsNotNull(array, "Expected array type reference"); + Assert.IsFalse(node.AssemblyName.HasNodeErrors); + } + + [TestMethod] + [DataRow("Domain.Company.Product.DotVVM.Feature.Type[]")] + [DataRow("Domain.Company.Product.DotVVM.Feature.Type[]")] + public void BindingParser_ArrayType_ValidAssemblyName(string binding) + { + var parser = bindingParserNodeFactory.SetupParser(binding); + var array = parser.ReadDirectiveTypeName() as ArrayTypeReferenceBindingParserNode; + + Assert.IsNotNull(array, "Expected array type reference"); + Assert.IsFalse(array.HasNodeErrors); + } + [TestMethod] [DataRow("Domain.Company.Product.DotVVM.Feature.Type, Domain.Company.Product")] [DataRow("Domain.Company.Product.DotVVM.Feature.Type, Product")]