History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: RSRP-49307
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Normal Normal
Assignee: Olga Lobacheva
Reporter: Vladimir Reshetnikov
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
ReSharper

error CS0221: Constant value '-1' cannot be converted to a 'byte' (use 'unchecked' syntax to override)

Created: 15 Sep 07 20:39   Updated: 03 Oct 07 17:58
Component/s: None
Fix Version/s: 4.0, 3.1
Security Level: Everybody (All jira users)

Original Estimate: Unknown Remaining Estimate: Unknown Time Spent: Unknown

Build: 521


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

See C# 3.0 Specification Draft, 7.5.12 The checked and unchecked operators
The body of an anonymous function is not affected by checked or unchecked contexts in which the anonymous function occurs.



 All   Comments   Work Log   Change History      Sort Order:
There are no comments yet on this issue.