Allow IntPtr
and UIntPtr
in attributes
#8155
-
Currently using public class FooAttribute
{
public FooAttribute(IntPtr num)
{
// ...
}
} In addition, §22.2.4 only constrains types allowed in attributes to...
and my proposal would allow the usage of |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
I don't think it makes sense to use |
Beta Was this translation helpful? Give feedback.
I don't think it makes sense to use
IntPtr
in attributes as the actual data embedded in the assembly metadata needs to be a known predictable size at compile time. It can't change to accommodate a different size based on the native word size. So at best it would still be along
orulong
, which you could then cast back to anIntPtr
in code anyway.