You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we bind string as string! when the nullability feature is on, but as string~ (oblivious) when the feature is off (LangVersion=7 for example).
The scenario driving this is a C# 7.0 compilation being referenced in a C# 8.0 compilation. We want symbols from the compilation reference to be re-used, but we want the C# 8.0 compilation to treat them as oblivious.
A few options we discussed so far:
bind symbols differently depending on features being on/off (current design)
wrap symbols from compilation references in some cases, rather than re-use them directly (so a string! from a C# 7.0 compilation reference appears as oblivious to the C# 8.0 compilation)
have the caller be smart (you're given a source symbol, you should check if it comes from a compilation with nullability on/off). (this seems error-prone)
The text was updated successfully, but these errors were encountered:
Tagging @AlekseyTs@gafter@cston to start discussion.
How strongly do we want to stick to the rule that binding should produce the same result regardless of features that are turned on/off or language version?
I don't think the current behavior should be treated as a rule violation. The rule is more like: "If you have a syntactic construct that clearly "points" to a new feature, bind it as such even if feature is not allowed and report an appropriate diagnostic". In this case, there is no special syntax indicating that any new feature is used.
Currently, we bind
string
asstring!
when the nullability feature is on, but asstring~
(oblivious) when the feature is off (LangVersion=7 for example).The scenario driving this is a C# 7.0 compilation being referenced in a C# 8.0 compilation. We want symbols from the compilation reference to be re-used, but we want the C# 8.0 compilation to treat them as oblivious.
A few options we discussed so far:
string!
from a C# 7.0 compilation reference appears as oblivious to the C# 8.0 compilation)The text was updated successfully, but these errors were encountered: