Reporter | Vladimir Reshetnikov (nikov) |
---|---|
Created | Sep 27, 2006 2:28:26 PM |
Updated | Apr 14, 2012 6:01:54 AM |
Priority | Normal |
Type | Bug |
Fix versions | Mirabile Futurum |
State | Open |
Assignee | Evgeny Pasynkov (pasynkov) |
Subsystem | Code Analysis |
Affected versions | No Affected versions |
Fixed in build | No Fixed in build |
ReSharper cannot detect the following errors:
ECMA-335 (CLI)
8.2.4 Boxing and unboxing of values
A type is
boxable if it is one of the following:
• A value type (including instantiations of generic value types) that does not contain fields that can point into
the CIL evaluation stack
[Rationale: A value type that does contain such fields cannot be boxed, else those embedded pointers
could outlive the entries in the CIL evaluation stack to which they point; e.g.,
System.RuntimeArgumentHandle, System.TypedReference. Value types that contain such pointers are
informally described as "byref-like" value types. end rationale]
using System; class A { static void Main() { new TypedReference().GetType(); // error CS0029: Cannot implicitly convert type 'System.TypedReference' to 'object' new TypedReference().ToString(); // error CS0029: Cannot implicitly convert type 'System.TypedReference' to 'System.ValueType' } }
ECMA-335 (CLI)
8.2.4 Boxing and unboxing of values
A type is
boxable if it is one of the following:
• A value type (including instantiations of generic value types) that does not contain fields that can point into
the CIL evaluation stack
[Rationale: A value type that does contain such fields cannot be boxed, else those embedded pointers
could outlive the entries in the CIL evaluation stack to which they point; e.g.,
System.RuntimeArgumentHandle, System.TypedReference. Value types that contain such pointers are
informally described as "byref-like" value types. end rationale]