-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
Usings should be able to bind to declarations from previous submissions #4811
Comments
Was internal bug 528436. |
See also internal bug 528258: the semantic model does consider previous submissions when binding usings, so it may disagree with the batch compiler. |
Since you can't declare namespaces in script/interactive code, only using aliases are affected. |
@ManishJayaswal Since only using aliases are affected, I don't believe this meets the preview bar. |
@amcasey sounds good. |
It is also impossible to alias a type declared in the same compilation. |
The root of the problem seems to be that |
Consider mining https://github.com/amcasey/roslyn/tree/AbandonedGH4811. |
Fixes dotnet#5450 Lays groundwork for dotnet#4811 and dotnet#5423
We had hoped we could fix this later, but it's not additive. Specifically, it changes the binding rules for using. |
1. Look for declarations in the current submission (including aliases). 2. Look for declarations in preceding submissions (including aliases), in order. 3. Look for members in the host object (if any). 4. Look for declarations in the global namespace. 5. Look in usings (except aliases) in the current submission and all preceding submissions (all at once, not looping). 6. Look in the global imports of the current submission and all preceding submissions (all at once, not looping). Note that 5, 6, and aliases from 1 are skipped if we are binding the target of a using in the current submission. Fixes dotnet#5450 Fixes dotnet#4811
@genlu Can you please verify this? |
This case would be affected if it were legal (which it's not).
The text was updated successfully, but these errors were encountered: