Skip to content

Constants as a default value issue #18

Closed
@ChebanovDD

Description

@ChebanovDD

Describe the bug

It is impossible to use constants as the default value for UxmlAttribute.

The following code generates: error UXMLG003: UxmlAttribute for 'MaxTextLength' property was not created. The default property and attribute value must be of the same type.

private const int DefaultMaxLength = -1;
        
[UxmlAttribute(DefaultMaxLength)]
private int MaxTextLength { get; set; }

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions