@@ -383,6 +383,7 @@ public static UnboundLambda Create(
383383 ImmutableArray < TypeWithAnnotations > types ,
384384 ImmutableArray < string > names ,
385385 ImmutableArray < bool > discardsOpt ,
386+ ImmutableArray < bool > nullCheckedOpt ,
386387 bool isAsync ,
387388 bool isStatic )
388389 {
@@ -391,7 +392,7 @@ public static UnboundLambda Create(
391392 bool hasErrors = ! types . IsDefault && types . Any ( t => t . Type ? . Kind == SymbolKind . ErrorType ) ;
392393
393394 var functionType = FunctionTypeSymbol . CreateIfFeatureEnabled ( syntax , binder , static ( binder , expr ) => ( ( UnboundLambda ) expr ) . Data . InferDelegateType ( ) ) ;
394- var data = new PlainUnboundLambdaState ( binder , returnRefKind , returnType , parameterAttributes , names , discardsOpt , types , refKinds , isAsync , isStatic , includeCache : true ) ;
395+ var data = new PlainUnboundLambdaState ( binder , returnRefKind , returnType , parameterAttributes , names , discardsOpt , nullCheckedOpt , types , refKinds , isAsync , isStatic , includeCache : true ) ;
395396 var lambda = new UnboundLambda ( syntax , data , functionType , withDependencies , hasErrors : hasErrors ) ;
396397 data . SetUnboundLambda ( lambda ) ;
397398 functionType ? . SetExpression ( lambda . WithNoCache ( ) ) ;
@@ -458,6 +459,7 @@ public TypeWithAnnotations InferReturnType(ConversionsBase conversions, NamedTyp
458459 public Location ParameterLocation ( int index ) { return Data . ParameterLocation ( index ) ; }
459460 public string ParameterName ( int index ) { return Data . ParameterName ( index ) ; }
460461 public bool ParameterIsDiscard ( int index ) { return Data . ParameterIsDiscard ( index ) ; }
462+ public bool ParameterIsNullChecked ( int index ) { return Data . ParameterIsNullChecked ( index ) ; }
461463 }
462464
463465 internal abstract class UnboundLambdaState
@@ -517,6 +519,7 @@ internal UnboundLambdaState WithCaching(bool includeCache)
517519 public abstract MessageID MessageID { get ; }
518520 public abstract string ParameterName ( int index ) ;
519521 public abstract bool ParameterIsDiscard ( int index ) ;
522+ public abstract bool ParameterIsNullChecked ( int index ) ;
520523 public abstract SyntaxList < AttributeListSyntax > ParameterAttributes ( int index ) ;
521524 public abstract bool HasSignature { get ; }
522525 public abstract bool HasExplicitReturnType ( out RefKind refKind , out TypeWithAnnotations returnType ) ;
@@ -1321,6 +1324,7 @@ internal sealed class PlainUnboundLambdaState : UnboundLambdaState
13211324 private readonly ImmutableArray < SyntaxList < AttributeListSyntax > > _parameterAttributes ;
13221325 private readonly ImmutableArray < string > _parameterNames ;
13231326 private readonly ImmutableArray < bool > _parameterIsDiscardOpt ;
1327+ private readonly ImmutableArray < bool > _parameterIsNullCheckedOpt ;
13241328 private readonly ImmutableArray < TypeWithAnnotations > _parameterTypesWithAnnotations ;
13251329 private readonly ImmutableArray < RefKind > _parameterRefKinds ;
13261330 private readonly bool _isAsync ;
@@ -1333,6 +1337,7 @@ internal PlainUnboundLambdaState(
13331337 ImmutableArray < SyntaxList < AttributeListSyntax > > parameterAttributes ,
13341338 ImmutableArray < string > parameterNames ,
13351339 ImmutableArray < bool > parameterIsDiscardOpt ,
1340+ ImmutableArray < bool > parameterIsNullCheckedOpt ,
13361341 ImmutableArray < TypeWithAnnotations > parameterTypesWithAnnotations ,
13371342 ImmutableArray < RefKind > parameterRefKinds ,
13381343 bool isAsync ,
@@ -1345,6 +1350,7 @@ internal PlainUnboundLambdaState(
13451350 _parameterAttributes = parameterAttributes ;
13461351 _parameterNames = parameterNames ;
13471352 _parameterIsDiscardOpt = parameterIsDiscardOpt ;
1353+ _parameterIsNullCheckedOpt = parameterIsNullCheckedOpt ;
13481354 _parameterTypesWithAnnotations = parameterTypesWithAnnotations ;
13491355 _parameterRefKinds = parameterRefKinds ;
13501356 _isAsync = isAsync ;
@@ -1414,6 +1420,11 @@ public override bool ParameterIsDiscard(int index)
14141420 return _parameterIsDiscardOpt . IsDefault ? false : _parameterIsDiscardOpt [ index ] ;
14151421 }
14161422
1423+ public override bool ParameterIsNullChecked ( int index )
1424+ {
1425+ return _parameterIsNullCheckedOpt . IsDefault ? false : _parameterIsNullCheckedOpt [ index ] ;
1426+ }
1427+
14171428 public override RefKind RefKind ( int index )
14181429 {
14191430 Debug . Assert ( 0 <= index && index < _parameterTypesWithAnnotations . Length ) ;
@@ -1429,7 +1440,7 @@ public override TypeWithAnnotations ParameterTypeWithAnnotations(int index)
14291440
14301441 protected override UnboundLambdaState WithCachingCore ( bool includeCache )
14311442 {
1432- return new PlainUnboundLambdaState ( Binder , _returnRefKind , _returnType , _parameterAttributes , _parameterNames , _parameterIsDiscardOpt , _parameterTypesWithAnnotations , _parameterRefKinds , _isAsync , _isStatic , includeCache ) ;
1443+ return new PlainUnboundLambdaState ( Binder , _returnRefKind , _returnType , _parameterAttributes , _parameterNames , _parameterIsDiscardOpt , _parameterIsNullCheckedOpt , _parameterTypesWithAnnotations , _parameterRefKinds , _isAsync , _isStatic , includeCache ) ;
14331444 }
14341445
14351446 protected override BoundExpression ? GetLambdaExpressionBody ( BoundBlock body )
0 commit comments