Skip to content

Commit

Permalink
Attribute literals should not be DefaultValueExpressions
Browse files Browse the repository at this point in the history
  • Loading branch information
MikaelMayer committed Nov 20, 2024
1 parent 26b15a4 commit c90dd8b
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Source/DafnyCore/AST/Attributes.cs
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,8 @@ static BuiltInAtAttributeSyntax BuiltIn(string name) {

// Helper to create an old-style attribute
private static Attributes A(string name, params Expression[] args) {
return new Attributes(name, args.ToList(), null);
return new Attributes(name, args.Select(arg =>
arg is DefaultValueExpression defaultExpr ? defaultExpr.Resolved : arg).ToList(), null);
}

// Helper to create an old-style attribute with only one argument
Expand Down

0 comments on commit c90dd8b

Please sign in to comment.