From 698edcd254116913a0bac45ea9dc65784f9cf825 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Milan=20Miku=C5=A1?= Date: Wed, 25 Oct 2023 22:04:16 +0200 Subject: [PATCH] declaration directive attribute type reference fixed --- .../Directives/PropertyDeclarationDirectiveCompiler.cs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Framework/Framework/Compilation/Directives/PropertyDeclarationDirectiveCompiler.cs b/src/Framework/Framework/Compilation/Directives/PropertyDeclarationDirectiveCompiler.cs index fedc9579e6..90910a6dc0 100644 --- a/src/Framework/Framework/Compilation/Directives/PropertyDeclarationDirectiveCompiler.cs +++ b/src/Framework/Framework/Compilation/Directives/PropertyDeclarationDirectiveCompiler.cs @@ -75,7 +75,7 @@ protected override IAbstractPropertyDeclarationDirective Resolve(DothtmlDirectiv var attributePropertyNameReference = attributePropertyReference?.MemberNameExpression; var initializer = assignment.SecondExpression as LiteralExpressionBindingParserNode; - if (attributeTypeReference is not TypeReferenceBindingParserNode attributeType || attributePropertyNameReference == null) + if (attributeTypeReference is null || attributePropertyNameReference is null) { directiveNode.AddError("Property attributes must be in the form Attribute.Property = value."); continue; @@ -85,7 +85,10 @@ protected override IAbstractPropertyDeclarationDirective Resolve(DothtmlDirectiv directiveNode.AddError($"Value for property {attributeTypeReference.ToDisplayString()} of attribute {attributePropertyNameReference.ToDisplayString()} is missing or not a constant."); continue; } - result.Add(new (attributeType, attributePropertyNameReference, initializer)); + + var type = new ActualTypeReferenceBindingParserNode(attributeTypeReference); + type.TransferTokens(attributeTypeReference); + result.Add(new (type, attributePropertyNameReference, initializer)); } return result; }