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

Using statements are not added automatically for implicit types in lambdas #272

Open
donluispanis opened this issue Oct 5, 2020 · 0 comments

Comments

@donluispanis
Copy link

donluispanis commented Oct 5, 2020

Given the following class

using System.Collections.Generic;

public class MyClass
{
    public delegate void MyDelegate(IDictionary<object, object> dictionary);

    public MyClass(MyDelegate myDelegate) {  }
}

this statement will fail to compile

MyClass myClass = new MyClass((dictionary) => { });

unless we add using System.Collections.Generic; to the file where we new MyClass up with a lambda.

DSharp does not include by default the usings for implicit types (IDictionary in this case) and hence, it's not able to find them. It outputs the following error: error DS0003: Object reference not set to an instance of an object.

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