If only I were

Building Great Software

C# Compiler Discrepancies

leave a comment »

Technorati Tags: ,

Eric Sink just posted an issue that seems to show an error with the C# compiler.

public bool IsOrange1()
{
}

public bool IsOrange2()
{
    while (true)
    {
    }
}

‘IsOrange1’ fails with a compilation error while ‘IsOrange2’ doesn’t even give a warning.  Neither of them have a return statement which should always gives a compiler error in a non-void function to the best of my knowledge. 

I’ll have to go back to the C# spec and see if there is any room for this compiler behavior.

Advertisements

Written by Chris Sutton

October 5, 2007 at 12:47 pm

Posted in Technology

Tagged with

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: