Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Declaring a field with the same name as a type #428

Open
imnaseer opened this issue Sep 15, 2014 · 0 comments
Open

Declaring a field with the same name as a type #428

imnaseer opened this issue Sep 15, 2014 · 0 comments

Comments

@imnaseer
Copy link

The compiler generates a truncated file if the code does a type check on a type and there is a field with the same name as the type.

The following snippet will reproduce the internal crash:

public class Class1
{
    public BaseClass BaseClass = new BaseClass();

    public void Foo()
    {
        BaseClass obj = new BaseClass();
        bool isBaseClass;
        if (obj is BaseClass)
        {
            isBaseClass = true;
        }
       else
       {
           isBaseClass = false;
       }
    }
}

Changing the field named BaseClass to another name and/or removing the "is" type check will lead to correct js code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant