New Delphi 10.3 Warning "Unknown Custom Attribute"

  

Up to Delphi 102, if you used a custom attribute that was not known to the compiler (because you typed it incorrectly or a unit was missing in the uses statement), you’d receive the warning:

Warning: W1025 Unsupported language feature: ‘custom attribute’
This message was misleading, because the feature has been in the language for quite some time, it was just using an undefined symbol in it. There is a large list of reports on this issue, including https://quality.embarcadero.com/browse/RSP-20384. 
Starting with 10.3, the same code will trigger a new specific warning:

Warning: W1074 Unknown custom attribute
This conveys a more specific information. It also makes it is easier to turn this warning into an error — which would often make sense, by using the directive:

{$WARN UNKNOWN_CUSTOM_ATTRIBUTE ERROR}
In the past you could achieve the same by turning the unsupported language feature warnings into errors, but that could have included also other unwanted scenarios.

Comments are closed.