Compilation of an attribute yields an attribute class T
, constructor C
on T, positional-argument-list P
and named-argument-list N
. Given this information, an attribute instance can be retrieved at run-time using the following steps:
T(P)
, using the constructor C
as determined at compile-time. These steps either result in an exception, or produce an instance of T
. Call this instance O
.Arg
in N
, in order:
Name
be the identifier of the named-argument Arg
. If Name
does not identify a non-static public read-write field or property on O
, then an exception (TODO: which exception?) is thrown.Value
be the result of evaluating the attribute-argument-expression of Arg
.Name
identifies a field on O
, then set this field to the value Value
.Name
identifies a property on O
. Set this property to the value Value
.O
, an instance of the attribute class T
that has been initialized with the positional-argument-list P
and the named-argument-list N
.