Priority
Normal
Type
Bug 
State
Fixed 
Assignee
Olga Lobacheva 
Subsystem
No subsystem 
Affected versions
Fixed in
Fixed in build
Next build 
Build
521
  • Submitted by   Vladimir Reshetnikov
    2 years ago (15 Sep 2007 20:57)
  • Updated by Vladimir Reshetnikov
    2 years ago (03 Oct 2007 17:48)
  • Jira: RSRP-49309
    (history, comments)

RSRP-49309

'checked' statements are not taken into account during constant expression evaluation

0
class A
{
    static void Foo()
    {
        unchecked
        {
            checked
            {
                const byte x = (byte)-1; // error CS0221: Constant value '-1' cannot be converted to a 'byte' (use 'unchecked' syntax to override)
            }
        }
    }
}


I suppose, the problem in CSharpExpressionBase.IsCheckedContext

Issue was closed
Comments (0)
 
History (0)
 
Links
 
Issue has no comments