About pointer to class, what is the difference between CS8500 & CS0208? #82664
-
This code snippet will cause error CS0208 in SDK 6.0.406, And in this spec, it is said that:
Does the scope extend in new version SDK? I only see a relative breaking change about |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Before C# 11, it was an error for a pointer to point to a managed type in all circumstances. In C# 11, most of the errors were turned into warnings. See the associated proposal:
The error is still used where managed types are strictly disallowed. For example, public void M()
{
var z = stackalloc object[10];
} will still emit an error CS0208, because |
Beta Was this translation helpful? Give feedback.
Before C# 11, it was an error for a pointer to point to a managed type in all circumstances. In C# 11, most of the errors were turned into warnings. See the associated proposal:
The error is still used where managed types are strictly disallow…