Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
115 commits
Select commit Hold shift + click to select a range
3816bf8
Parsing for Parameter Nullchecking (#35826)
fayrose May 30, 2019
650a8d7
Merge master with param-nullchecking (#36070)
fayrose May 31, 2019
1f0d02f
Merge remote-tracking branch 'origin/features/param-nullchecking' int…
JoeRobich Jun 3, 2019
54b6387
Merge pull request #36077 from dotnet/merges/master-to-features/param…
Jun 4, 2019
584982b
Merge pull request #36145 from dotnet/merges/master-to-features/param…
Jun 4, 2019
ca55da0
Features/nullchecking error binding (#36095)
fayrose Jun 4, 2019
c96b016
Merge remote-tracking branch 'origin/features/param-nullchecking' int…
JoeRobich Jun 5, 2019
f8050ff
Merge pull request #36171 from dotnet/merges/master-to-features/param…
Jun 5, 2019
48f005f
Merge pull request #36199 from dotnet/merges/master-to-features/param…
Jun 6, 2019
adb2e77
Merge pull request #36207 from dotnet/merges/master-to-features/param…
Jun 6, 2019
fcde686
Merge pull request #36231 from dotnet/merges/master-to-features/param…
Jun 7, 2019
0d774a5
Merge pull request #36235 from dotnet/merges/master-to-features/param…
Jun 7, 2019
409bb04
Merge pull request #36257 from dotnet/merges/master-to-features/param…
Jun 10, 2019
3754748
Merge remote-tracking branch 'upstream/master' into merges/master-to-…
RikkiGibson Jun 10, 2019
f0a9368
Merge remote-tracking branch 'origin/master' into merges/master-to-fe…
JoeRobich Jun 11, 2019
e9124ed
Merge pull request #36280 from dotnet/merges/master-to-features/param…
Jun 11, 2019
d6b0118
Merge pull request #36303 from dotnet/merges/master-to-features/param…
Jun 11, 2019
3e72bb0
Param nullchecking binding (#36247)
fayrose Jun 11, 2019
0cbdca9
Merge pull request #36325 from dotnet/merges/master-to-features/param…
Jun 11, 2019
d7c97f7
Merge pull request #36343 from dotnet/merges/master-to-features/param…
Jun 12, 2019
2aad1b0
Merge pull request #36363 from dotnet/merges/master-to-features/param…
Jun 12, 2019
8f47426
Merge pull request #36376 from dotnet/merges/master-to-features/param…
Jun 12, 2019
4cc2600
Merge pull request #36394 from dotnet/merges/master-to-features/param…
Jun 13, 2019
a25a2be
Merge pull request #36425 from dotnet/merges/master-to-features/param…
Jun 13, 2019
2f8cef2
Merge pull request #36442 from dotnet/merges/master-to-features/param…
Jun 14, 2019
13ee0f8
Merge pull request #36479 from dotnet/merges/master-to-features/param…
Jun 15, 2019
e74f602
Merge pull request #36490 from dotnet/merges/master-to-features/param…
Jun 15, 2019
32017d1
Merge pull request #36531 from dotnet/merges/master-to-features/param…
Jun 18, 2019
fa959cd
Merge pull request #36558 from dotnet/merges/master-to-features/param…
Jun 19, 2019
2490bf4
Merge pull request #36580 from dotnet/merges/master-to-features/param…
Jun 19, 2019
b3e3292
Merge remote-tracking branch 'origin/features/param-nullchecking' int…
JoeRobich Jun 20, 2019
7ad94b8
Merge pull request #36603 from dotnet/merges/master-to-features/param…
Jun 20, 2019
013bacd
Merge pull request #36639 from dotnet/merges/master-to-features/param…
Jun 21, 2019
5361c72
Merge pull request #36650 from dotnet/merges/master-to-features/param…
Jun 21, 2019
8ea1ba1
Merge pull request #36662 from dotnet/merges/master-to-features/param…
Jun 22, 2019
896ee71
Merge pull request #36688 from dotnet/merges/master-to-features/param…
Jun 22, 2019
f0bb068
Merge pull request #36700 from dotnet/merges/master-to-features/param…
Jun 24, 2019
df49bc1
Merge pull request #36725 from dotnet/merges/master-to-features/param…
Jun 25, 2019
5aae233
Merge pull request #36752 from dotnet/merges/master-to-features/param…
Jun 25, 2019
5e58b2d
Merge pull request #36767 from dotnet/merges/master-to-features/param…
Jun 26, 2019
cf81eb8
Merge pull request #36778 from dotnet/merges/master-to-features/param…
Jun 26, 2019
6e5db2d
Method Declaration and Indexed Variable Lowering/Code Gen (#36471)
fayrose Jun 27, 2019
720e99d
Merge pull request #36809 from dotnet/merges/master-to-features/param…
Jun 27, 2019
2511eaf
Merge pull request #36828 from dotnet/merges/master-to-features/param…
RikkiGibson Jun 27, 2019
619a0c0
Merge pull request #36851 from dotnet/merges/master-to-features/param…
Jun 28, 2019
012ad4a
Merge pull request #36862 from dotnet/merges/master-to-features/param…
Jun 28, 2019
31c2df7
Merge pull request #36888 from dotnet/merges/master-to-features/param…
Jun 29, 2019
37b50ab
Merge pull request #36892 from dotnet/merges/master-to-features/param…
Jun 29, 2019
3d68438
Merge pull request #36923 from dotnet/merges/master-to-features/param…
Jul 2, 2019
45aa5d3
Merge pull request #36929 from dotnet/merges/master-to-features/param…
Jul 2, 2019
3ef7e34
Merge pull request #36944 from dotnet/merges/master-to-features/param…
Jul 3, 2019
bead008
Merge pull request #36955 from dotnet/merges/master-to-features/param…
Jul 3, 2019
7dc8f29
Nullchecked Lambdas and Local Functions + Constructor Tests (#36832)
fayrose Jul 3, 2019
a3d82e7
Merge pull request #36971 from dotnet/merges/master-to-features/param…
Jul 3, 2019
f3c7aef
Merge pull request #36988 from dotnet/merges/master-to-features/param…
Jul 4, 2019
8154730
Merge pull request #37000 from dotnet/merges/master-to-features/param…
Jul 5, 2019
8fe4b45
Merge pull request #37028 from dotnet/merges/master-to-features/param…
RikkiGibson Jul 6, 2019
317c253
Merge pull request #37062 from dotnet/merges/master-to-features/param…
Jul 9, 2019
07eceb5
Merge pull request #37079 from dotnet/merges/master-to-features/param…
Jul 9, 2019
ca6f780
Merge pull request #37094 from dotnet/merges/master-to-features/param…
Jul 10, 2019
8a434f5
Merge pull request #37102 from dotnet/merges/master-to-features/param…
Jul 10, 2019
fb2a494
Merge pull request #37114 from dotnet/merges/master-to-features/param…
Jul 10, 2019
96ad732
Merge pull request #37131 from dotnet/merges/master-to-features/param…
Jul 11, 2019
0b9bda0
Merge pull request #37144 from dotnet/merges/master-to-features/param…
RikkiGibson Jul 14, 2019
57c9d59
Merge branch 'features/param-nullchecking' into merges/master-to-feat…
RikkiGibson Jul 15, 2019
edbbfcc
Merge pull request #37219 from dotnet/merges/master-to-features/param…
Jul 15, 2019
be9ae33
Nullchecked Iterators + Error Messages (#36979)
fayrose Jul 17, 2019
0f11715
CFG for Parameter Nullchecking (#37381)
fayrose Jul 30, 2019
1d0776f
Added language check to null-checked parameters in parsing (#37585)
fayrose Jul 31, 2019
97d61b2
Merge remote-tracking branch 'remote/master' into merges/master-to-fe…
Jul 31, 2019
8a42a42
Merge pull request #37257 from dotnet/merges/master-to-features/param…
Jul 31, 2019
803a8bb
Merge pull request #37644 from dotnet/merges/master-to-features/param…
Aug 2, 2019
fe50866
Merge pull request #37671 from dotnet/merges/master-to-features/param…
Aug 2, 2019
c9feca0
Merge pull request #37688 from dotnet/merges/master-to-features/param…
Aug 3, 2019
da993e4
Merge pull request #37702 from dotnet/merges/master-to-features/param…
Aug 3, 2019
460b38d
Merge pull request #37736 from dotnet/merges/master-to-features/param…
Aug 5, 2019
401bd1c
Merge pull request #37746 from dotnet/merges/master-to-features/param…
Aug 6, 2019
2ca0209
Merge pull request #37776 from dotnet/merges/master-to-features/param…
Aug 7, 2019
19c19ec
Merge remote-tracking branch 'origin/master' into m
jaredpar Jul 16, 2020
2cf8ba0
Merge remote-tracking branch 'upstream/master' into features/pnc-upda…
Jul 28, 2020
eda615d
Merge pull request #46388 from kevinsun-dev/features/pnc-update-r3
jaredpar Jul 28, 2020
3f382cb
Bring features/param-nullchecking up to date (#46398)
Jul 31, 2020
3b0b5e1
[features/param-nullchecking] The BangBang Update (#46520)
Aug 11, 2020
5f0a324
Merge remote-tracking branch 'upstream/main' into merge-main-with-con…
RikkiGibson Oct 20, 2021
f5b488c
Merge main to features/param-nullchecking with conflicts (#57278)
RikkiGibson Oct 20, 2021
f907633
Merge pull request #57280 from RikkiGibson/resolve-conflicts
RikkiGibson Oct 20, 2021
6ba3dea
Fix param-nullchecking build/test failures (#57375)
RikkiGibson Nov 1, 2021
67eaccd
Merge remote-tracking branch 'upstream/main' into merges/main-to-feat…
RikkiGibson Nov 1, 2021
38e86e0
Merge pull request #57512 from dotnet/merges/main-to-features/param-n…
Nov 2, 2021
cabcb95
Use helpers in param-nullchecking emit (#57615)
RikkiGibson Nov 18, 2021
4e7c469
Merge branch 'main' of github.com:dotnet/roslyn into merges/main-to-f…
RikkiGibson Nov 18, 2021
7854604
Merge pull request #57866 from RikkiGibson/merges/main-to-features/pa…
Nov 19, 2021
ed3de52
Merge pull request #57934 from RikkiGibson/pnc-refactoring
RikkiGibson Dec 8, 2021
0d823b7
Move some mocks out to the base test utilities namespace
jasonmalinowski Dec 9, 2021
96698d9
Merge remote-tracking branch 'upstream/main' into merges/main-to-feat…
RikkiGibson Dec 13, 2021
4bbf0c0
Merge pull request #58183 from dotnet/merges/main-to-features/param-n…
RikkiGibson Dec 13, 2021
6ac435c
Support "Enable nullable reference types" on the entire directive
sharwell Dec 14, 2021
81d83ce
Support "Enable nullable reference types" from restore keyword
sharwell Dec 14, 2021
b885da9
Support "Enable nullable reference types" from disable keyword
sharwell Dec 14, 2021
60c7538
Ensure the CodeModel tests are using VisualStudioWorkspaceImpl
jasonmalinowski Dec 9, 2021
25d5cb9
Allow the FileCodeModel.Parent to be null
jasonmalinowski Dec 11, 2021
f89b4bf
Support CodeClass2.Parts returning parts in source generated files
jasonmalinowski Dec 4, 2021
81e44e1
Address various minor param-nullchecking issues (#58321)
RikkiGibson Dec 15, 2021
897223b
Resolve PROTOTYPE comments in param null checking (#58324)
jaredpar Dec 15, 2021
e9c4789
Change PROTOTYPE to issue reference (#58336)
RikkiGibson Dec 15, 2021
cdd0aca
Merge pull request #58316 from sharwell/nullable-refactoring
sharwell Dec 15, 2021
8c77f52
Merge pull request #58338 from dotnet/features/param-nullchecking
RikkiGibson Dec 15, 2021
ed49a2e
[main] Update dependencies from dotnet/arcade (#58327)
dotnet-maestro[bot] Dec 15, 2021
d0ceb67
Fix failure to propagate cancellation token
sharwell Dec 15, 2021
4bceea8
Swithc to acquiring the component model on a BG thread.
CyrusNajmabadi Dec 15, 2021
340021c
Merge pull request #58349 from sharwell/missing-cancellation
sharwell Dec 15, 2021
61a74aa
Record list-patterns and newlines in interpolations as done (#58250)
jcouv Dec 15, 2021
d6f231d
Merge pull request #58241 from jasonmalinowski/give-some-support-for-…
jasonmalinowski Dec 15, 2021
b246a00
Merge pull request #58351 from CyrusNajmabadi/componentModelBG
CyrusNajmabadi Dec 15, 2021
9cbcb29
Add support for nullable analysis in interpolated string handler cons…
333fred Dec 15, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions docs/Language Feature Status.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,20 @@ efforts behind them.

| Feature | Branch | State | Developer | Reviewer | LDM Champ |
| ------- | ------ | ----- | --------- | -------- | --------- |
| [Newlines in interpolations](https://github.com/dotnet/csharplang/issues/4935) | main | [Merged in 17.1p1](https://github.com/dotnet/roslyn/issues/57154) | [CyrusNajmabadi](https://github.com/CyrusNajmabadi) | [jcouv](https://github.com/jcouv), [chsienki](https://github.com/chsienki) | [CyrusNajmabadi](https://github.com/CyrusNajmabadi) |
| [List patterns](https://github.com/dotnet/csharplang/issues/3435) | [list-patterns](https://github.com/dotnet/roslyn/tree/features/list-patterns) | [Merged in 17.1p2](https://github.com/dotnet/roslyn/issues/51289) | [alrz](https://github.com/alrz) | [jcouv](https://github.com/jcouv), [333fred](https://github.com/333fred) | [333fred](https://github.com/333fred) |
| [Parameter null-checking](https://github.com/dotnet/csharplang/issues/2145) | [param-nullchecking](https://github.com/dotnet/roslyn/tree/features/param-nullchecking) | [In Progress](https://github.com/dotnet/roslyn/issues/36024) | [RikkiGibson](https://github.com/RikkiGibson), [fayrose](https://github.com/fayrose) | [cston](https://github.com/cston), [chsienki](https://github.com/chsienki) | [jaredpar](https://github.com/jaredpar) |
| [Raw string literals](https://github.com/dotnet/csharplang/issues/4304) | [RawStringLiterals](https://github.com/dotnet/roslyn/tree/features/features/RawStringLiterals) | [In Progress](https://github.com/dotnet/roslyn/issues/55306) | [CyrusNajmabadi](https://github.com/CyrusNajmabadi) | [jcouv](https://github.com/jcouv) | [CyrusNajmabadi](https://github.com/CyrusNajmabadi) |
| [nameof(parameter)](https://github.com/dotnet/csharplang/issues/373) | main | [In Progress](https://github.com/dotnet/roslyn/issues/40524) | [jcouv](https://github.com/jcouv) | TBD | [jcouv](https://github.com/jcouv) |
| [Relax ordering of `ref` and `partial` modifiers](https://github.com/dotnet/csharplang/issues/946) | [ref-partial](https://github.com/dotnet/roslyn/tree/features/ref-partial) | In Progress | [alrz](https://github.com/alrz) | [gafter](https://github.com/gafter) | [jcouv](https://github.com/jcouv) |
| [Parameter null-checking](https://github.com/dotnet/csharplang/issues/2145) | [param-nullchecking](https://github.com/dotnet/roslyn/tree/features/param-nullchecking) | [In Progress](https://github.com/dotnet/roslyn/issues/36024) | [RikkiGibson](https://github.com/RikkiGibson), [fayrose](https://github.com/fayrose) | [cston](https://github.com/cston), [chsienki](https://github.com/chsienki) | [jaredpar](https://github.com/jaredpar) |
| [Generic attributes](https://github.com/dotnet/csharplang/issues/124) | [generic-attributes](https://github.com/dotnet/roslyn/tree/features/generic-attributes) | [Merged into 17.0p4 (preview langver)](https://github.com/dotnet/roslyn/issues/36285) | [AviAvni](https://github.com/AviAvni) | [RikkiGibson](https://github.com/RikkiGibson), [jcouv](https://github.com/jcouv) | [mattwar](https://github.com/mattwar) |
| [Default in deconstruction](https://github.com/dotnet/roslyn/pull/25562) | [decon-default](https://github.com/dotnet/roslyn/tree/features/decon-default) | [Implemented](https://github.com/dotnet/roslyn/issues/25559) | [jcouv](https://github.com/jcouv) | [gafter](https://github.com/gafter) | [jcouv](https://github.com/jcouv) |
| [List patterns](https://github.com/dotnet/csharplang/issues/3435) | [list-patterns](https://github.com/dotnet/roslyn/tree/features/list-patterns) | [In Progress](https://github.com/dotnet/roslyn/issues/51289) | [alrz](https://github.com/alrz) | [jcouv](https://github.com/jcouv), [333fred](https://github.com/333fred) | [333fred](https://github.com/333fred) |
| [Raw string literals](https://github.com/dotnet/csharplang/issues/4304) | [RawStringLiterals](https://github.com/dotnet/roslyn/tree/features/features/RawStringLiterals) | [In Progress](https://github.com/dotnet/roslyn/issues/55306) | [CyrusNajmabadi](https://github.com/CyrusNajmabadi) | [jcouv](https://github.com/jcouv) | [CyrusNajmabadi](https://github.com/CyrusNajmabadi) |
| [Semi-auto-properties](https://github.com/dotnet/csharplang/issues/140) | [semi-auto-properties](https://github.com/dotnet/roslyn/tree/features/features/semi-auto-properties) | [In Progress](https://github.com/dotnet/roslyn/issues/57012) | [Youssef1313](https://github.com/Youssef1313) | TBD | [CyrusNajmabadi](https://github.com/CyrusNajmabadi) |
| [Required members](https://github.com/dotnet/csharplang/issues/3630) | [required-members](https://github.com/dotnet/roslyn/tree/features/required-members) | [In Progress](https://github.com/dotnet/roslyn/issues/57046) | [333fred](https://github.com/333fred) | [jcouv](https://github.com/jcouv), [RikkiGibson](https://github.com/RikkiGibson) | [333fred](https://github.com/333fred) |
| [Top Level statement attribute specifiers](https://github.com/dotnet/csharplang/issues/5045) | [main-attributes](https://github.com/dotnet/roslyn/tree/features/features/main-attributes) | [In Progress](https://github.com/dotnet/roslyn/issues/57047) | [chsienki](https://github.com/chsienki) | TBD | [jaredpar](https://github.com/jaredpar) |
| [Primary Constructors](https://github.com/dotnet/csharplang/issues/2691) | [primary-constructors](https://github.com/dotnet/roslyn/tree/features/features/primary-constructors) | [In Progress](https://github.com/dotnet/roslyn/issues/57048) | TBD | TBD | [MadsTorgersen](https://github.com/MadsTorgersen) |
| [Params Span<T> + Stackalloc any array type](https://github.com/dotnet/csharplang/issues/1757) | [params-span](https://github.com/dotnet/roslyn/tree/features/features/params-span) | [In Progress](https://github.com/dotnet/roslyn/issues/57049) | [cston](https://github.com/cston) | TBD | [jaredpar](https://github.com/jaredpar) |
| [Newlines in interpolations](https://github.com/dotnet/csharplang/issues/4935) | main | [In Progress](https://github.com/dotnet/roslyn/issues/57154) | [CyrusNajmabadi](https://github.com/CyrusNajmabadi) | [jcouv](https://github.com/jcouv), TBD | [CyrusNajmabadi](https://github.com/CyrusNajmabadi) |


# C# 10.0

Expand Down
8 changes: 4 additions & 4 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@
</Dependency>
</ProductDependencies>
<ToolsetDependencies>
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="7.0.0-beta.21610.4">
<Dependency Name="Microsoft.DotNet.Arcade.Sdk" Version="7.0.0-beta.21614.1">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>18adc5b47acce8bb03948baf578fca442d1029d4</Sha>
<Sha>cc0fa942bf43c2814af778868d4e7ddf21146b96</Sha>
<SourceBuild RepoName="arcade" ManagedOnly="true" />
</Dependency>
<Dependency Name="Microsoft.Net.Compilers.Toolset" Version="4.1.0-2.21609.7">
<Uri>https://github.com/dotnet/roslyn</Uri>
<Sha>818313426323d979747781a17c78860c833776da</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="7.0.0-beta.21610.4">
<Dependency Name="Microsoft.DotNet.Helix.Sdk" Version="7.0.0-beta.21614.1">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>18adc5b47acce8bb03948baf578fca442d1029d4</Sha>
<Sha>cc0fa942bf43c2814af778868d4e7ddf21146b96</Sha>
</Dependency>
</ToolsetDependencies>
</Dependencies>
4 changes: 2 additions & 2 deletions global.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"xcopy-msbuild": "16.10.0-preview2"
},
"msbuild-sdks": {
"Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.21610.4",
"Microsoft.DotNet.Helix.Sdk": "7.0.0-beta.21610.4"
"Microsoft.DotNet.Arcade.Sdk": "7.0.0-beta.21614.1",
"Microsoft.DotNet.Helix.Sdk": "7.0.0-beta.21614.1"
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ public QueryUnboundLambdaState(Binder binder, RangeVariableMap rangeVariableMap,

public override string ParameterName(int index) { return _parameters[index].Name; }
public override bool ParameterIsDiscard(int index) { return false; }
public override bool ParameterIsNullChecked(int index) { return false; }
public override SyntaxList<AttributeListSyntax> ParameterAttributes(int index) => default;
public override bool HasNames { get { return true; } }
public override bool HasSignature { get { return true; } }
Expand Down
14 changes: 2 additions & 12 deletions src/Compilers/CSharp/Portable/Binder/Binder.ValueChecks.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2798,12 +2798,7 @@ internal static uint GetValEscape(BoundExpression expr, uint scopeOfTheContainin

if (conversion.ConversionKind == ConversionKind.InterpolatedStringHandler)
{
var data = conversion.Operand switch
{
BoundInterpolatedString { InterpolationData: { } d } => d,
BoundBinaryOperator { InterpolatedStringHandlerData: { } d } => d,
_ => throw ExceptionUtilities.UnexpectedValue(conversion.Operand.Kind)
};
var data = conversion.Operand.GetInterpolatedStringHandlerData();
return GetInterpolatedStringHandlerConversionEscapeScope(data, scopeOfTheContainingExpression);
}

Expand Down Expand Up @@ -3592,12 +3587,7 @@ private static bool CheckValEscape(ImmutableArray<BoundExpression> expressions,
private static bool CheckInterpolatedStringHandlerConversionEscape(BoundExpression expression, uint escapeFrom, uint escapeTo, BindingDiagnosticBag diagnostics)
{

var data = expression switch
{
BoundInterpolatedString { InterpolationData: { } d } => d,
BoundBinaryOperator { InterpolatedStringHandlerData: { } d } => d,
_ => throw ExceptionUtilities.UnexpectedValue(expression.Kind)
};
var data = expression.GetInterpolatedStringHandlerData();

// We need to check to see if any values could potentially escape outside the max depth via the handler type.
// Consider the case where a ref-struct handler saves off the result of one call to AppendFormatted,
Expand Down
22 changes: 6 additions & 16 deletions src/Compilers/CSharp/Portable/Binder/Binder_Expressions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2993,8 +2993,7 @@ private void CoerceArguments<TMember>(
MemberResolutionResult<TMember> methodResult,
ArrayBuilder<BoundExpression> arguments,
BindingDiagnosticBag diagnostics,
TypeSymbol? receiverType,
uint receiverEscapeScope)
BoundExpression? receiver)
where TMember : Symbol
{
var result = methodResult.Result;
Expand All @@ -3012,7 +3011,7 @@ private void CoerceArguments<TMember>(
Debug.Assert(argument is BoundUnconvertedInterpolatedString or BoundBinaryOperator { IsUnconvertedInterpolatedStringAddition: true });
TypeWithAnnotations parameterTypeWithAnnotations = GetCorrespondingParameterTypeWithAnnotations(ref result, parameters, arg);
reportUnsafeIfNeeded(methodResult, diagnostics, argument, parameterTypeWithAnnotations);
arguments[arg] = BindInterpolatedStringHandlerInMemberCall(argument, arguments, parameters, ref result, arg, receiverType, receiverEscapeScope, diagnostics);
arguments[arg] = BindInterpolatedStringHandlerInMemberCall(argument, arguments, parameters, ref result, arg, receiver, methodResult.LeastOverriddenMember.RequiresInstanceReceiver(), diagnostics);
}
// https://github.com/dotnet/roslyn/issues/37119 : should we create an (Identity) conversion when the kind is Identity but the types differ?
else if (!kind.IsIdentity)
Expand Down Expand Up @@ -4809,13 +4808,7 @@ private BoundExpression BindObjectInitializerMember(
{
if (argument is BoundConversion { Conversion.IsInterpolatedStringHandler: true, Operand: var operand })
{
var handlerPlaceholders = operand switch
{
BoundBinaryOperator { InterpolatedStringHandlerData: { } data } => data.ArgumentPlaceholders,
BoundInterpolatedString { InterpolationData: { } data } => data.ArgumentPlaceholders,
_ => throw ExceptionUtilities.UnexpectedValue(operand.Kind)
};

var handlerPlaceholders = operand.GetInterpolatedStringHandlerData().ArgumentPlaceholders;
if (handlerPlaceholders.Any(placeholder => placeholder.ArgumentIndex == BoundInterpolatedStringArgumentPlaceholder.InstanceParameter))
{
diagnostics.Add(ErrorCode.ERR_InterpolatedStringsReferencingInstanceCannotBeInObjectInitializers, argument.Syntax.Location);
Expand Down Expand Up @@ -5745,7 +5738,7 @@ internal bool TryPerformConstructorOverloadResolution(

if (succeededIgnoringAccessibility)
{
this.CoerceArguments<MethodSymbol>(result.ValidResult, analyzedArguments.Arguments, diagnostics, receiverType: null, receiverEscapeScope: Binder.ExternalScope);
this.CoerceArguments<MethodSymbol>(result.ValidResult, analyzedArguments.Arguments, diagnostics, receiver: null);
}

// Fill in the out parameter with the result, if there was one; it might be inaccessible.
Expand Down Expand Up @@ -8012,11 +8005,6 @@ private BoundExpression BindIndexerOrIndexedPropertyAccess(
{
MemberResolutionResult<PropertySymbol> resolutionResult = overloadResolutionResult.ValidResult;
PropertySymbol property = resolutionResult.Member;
RefKind? receiverRefKind = receiver.GetRefKind();
uint receiverEscapeScope = property.RequiresInstanceReceiver && receiver != null
? receiverRefKind?.IsWritableReference() == true ? GetRefEscape(receiver, LocalScopeDepth) : GetValEscape(receiver, LocalScopeDepth)
: Binder.ExternalScope;
this.CoerceArguments<PropertySymbol>(resolutionResult, analyzedArguments.Arguments, diagnostics, receiver.Type, receiverEscapeScope);

var isExpanded = resolutionResult.Result.Kind == MemberResolutionKind.ApplicableInExpandedForm;
var argsToParams = resolutionResult.Result.ArgsToParamsOpt;
Expand All @@ -8028,6 +8016,8 @@ private BoundExpression BindIndexerOrIndexedPropertyAccess(

receiver = ReplaceTypeOrValueReceiver(receiver, property.IsStatic, diagnostics);

this.CoerceArguments<PropertySymbol>(resolutionResult, analyzedArguments.Arguments, diagnostics, receiver);

if (!gotError && receiver != null && receiver.Kind == BoundKind.ThisReference && receiver.WasCompilerGenerated)
{
gotError = IsRefOrOutThisParameterCaptured(syntax, diagnostics);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -808,8 +808,8 @@ private BoundExpression BindInterpolatedStringHandlerInMemberCall(
ImmutableArray<ParameterSymbol> parameters,
ref MemberAnalysisResult memberAnalysisResult,
int interpolatedStringArgNum,
TypeSymbol? receiverType,
uint receiverEscapeScope,
BoundExpression? receiver,
bool requiresInstanceReceiver,
BindingDiagnosticBag diagnostics)
{
Debug.Assert(unconvertedString is BoundUnconvertedInterpolatedString or BoundBinaryOperator { IsUnconvertedInterpolatedStringAddition: true });
Expand Down Expand Up @@ -916,9 +916,9 @@ private BoundExpression BindInterpolatedStringHandlerInMemberCall(
switch (argumentIndex)
{
case BoundInterpolatedStringArgumentPlaceholder.InstanceParameter:
Debug.Assert(receiverType is not null);
Debug.Assert(receiver!.Type is not null);
refKind = RefKind.None;
placeholderType = receiverType;
placeholderType = receiver.Type;
break;
case BoundInterpolatedStringArgumentPlaceholder.UnspecifiedParameter:
{
Expand Down Expand Up @@ -964,33 +964,40 @@ private BoundExpression BindInterpolatedStringHandlerInMemberCall(

SyntaxNode placeholderSyntax;
uint valSafeToEscapeScope;
bool isSuppressed;

switch (argumentIndex)
{
case BoundInterpolatedStringArgumentPlaceholder.InstanceParameter:
placeholderSyntax = unconvertedString.Syntax;
valSafeToEscapeScope = receiverEscapeScope;
Debug.Assert(receiver != null);
valSafeToEscapeScope = requiresInstanceReceiver
? receiver.GetRefKind().IsWritableReference() == true ? GetRefEscape(receiver, LocalScopeDepth) : GetValEscape(receiver, LocalScopeDepth)
: Binder.ExternalScope;
isSuppressed = receiver.IsSuppressed;
placeholderSyntax = receiver.Syntax;
break;
case BoundInterpolatedStringArgumentPlaceholder.UnspecifiedParameter:
placeholderSyntax = unconvertedString.Syntax;
valSafeToEscapeScope = Binder.ExternalScope;
isSuppressed = false;
break;
case >= 0:
placeholderSyntax = arguments[argumentIndex].Syntax;
valSafeToEscapeScope = GetValEscape(arguments[argumentIndex], LocalScopeDepth);
isSuppressed = arguments[argumentIndex].IsSuppressed;
break;
default:
throw ExceptionUtilities.UnexpectedValue(argumentIndex);
}

argumentPlaceholdersBuilder.Add(
new BoundInterpolatedStringArgumentPlaceholder(
(BoundInterpolatedStringArgumentPlaceholder)(new BoundInterpolatedStringArgumentPlaceholder(
placeholderSyntax,
argumentIndex,
valSafeToEscapeScope,
placeholderType,
hasErrors: argumentIndex == BoundInterpolatedStringArgumentPlaceholder.UnspecifiedParameter)
{ WasCompilerGenerated = true });
{ WasCompilerGenerated = true }.WithSuppression(isSuppressed)));
// We use the parameter refkind, rather than what the argument was actually passed with, because that will suppress duplicated errors
// about arguments being passed with the wrong RefKind. The user will have already gotten an error about mismatched RefKinds or it will
// be a place where refkinds are allowed to differ
Expand Down
Loading