Skip to content

Commit

Permalink
declaration directive attribute type reference fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Milan Mikuš committed Oct 25, 2023
1 parent f83ecd0 commit 698edcd
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
Expand Down

0 comments on commit 698edcd

Please sign in to comment.