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
This will be fixed in the 7.3 timeframe. The by value (1st in the example above) is better than the in reference version. This will not be a new article, but will require updates to Reference semantics with value types and affect the corresponding VB topics.
This feature will be delivered as a bug fix to C# 7.2. That means a machine with an updated compiler will use the new behavior. However, a machine that has not been updated will have the old 7.2 behavior.
The LDM notes and the feature spec will have details on this behavior.
I'm going to expand the scope of this somewhat. Looking at the content, I believe a number of locations were missed when in was added as a modifier to method arguments. I'll update those to mention in, and update the language reference on in and ref to explain the tiebreaker rule (and note that the rule only applies as of 7.3. In 7.2 the method call is ambiguous.
PR #4534 does the background work to add discussion of the in modifier where previously the out and ref modifiers were discussed without mention of in.
The new tiebreaker rule will come in a separate PR.
Activity
jcouv commentedon Jan 22, 2018
I think this tie-breaker is only applicable to C#. VB doesn't know how to deal with
in.@OmarTawfik can confirm.
OmarTawfik commentedon Jan 23, 2018
@jcouv Yes. Tie breaker is C# specific. VB sees
inparameters as references, and can use them where safety isn't an issue. For example, you can pass aninargument from VB by ref to a C# method, but you cannot override a baseinmethod from a parent C# type.This is the tie breaker PR: dotnet/roslyn#23122
VB Examples here: https://github.com/OmarTawfik/roslyn/blob/master/src/Compilers/VisualBasic/Test/Symbol/SymbolsTests/Metadata/PE/InAttributeModifierTests.vb
[-]C# and VB `in` by val tiebreaker[/-][+]C# `in` by val tiebreaker[/+]BillWagner commentedon Jan 23, 2018
Updated title based on @jcouv and @OmarTawfik comments.
BillWagner commentedon Feb 28, 2018
I'm going to expand the scope of this somewhat. Looking at the content, I believe a number of locations were missed when
inwas added as a modifier to method arguments. I'll update those to mentionin, and update the language reference oninandrefto explain the tiebreaker rule (and note that the rule only applies as of 7.3. In 7.2 the method call is ambiguous.BillWagner commentedon Mar 2, 2018
PR #4534 does the background work to add discussion of the
inmodifier where previously theoutandrefmodifiers were discussed without mention ofin.The new tiebreaker rule will come in a separate PR.
Update for new tiebreaker rules (#4677)