32 references to ToTypeWithAnnotations
Microsoft.CodeAnalysis.CSharp (31)
Binder\Binder_Patterns.cs (1)
1348var declType = TypeWithState.ForType(inputType).ToTypeWithAnnotations(Compilation);
FlowAnalysis\NullableWalker.cs (26)
275SetResult(expression, resultType: type, lvalueType: type.ToTypeWithAnnotations(compilation), updateAnalyzedNullability: updateAnalyzedNullability); 280SetAnalyzedNullability(expression, resultType: type, lvalueType: type.ToTypeWithAnnotations(compilation)); 288SetResult(expression, ResultType, ResultType.ToTypeWithAnnotations(compilation), isLvalue: false); 309private void SetInvalidResult() => SetResult(expression: null, _invalidType, _invalidType.ToTypeWithAnnotations(compilation), updateAnalyzedNullability: false); 2845_returnTypesOpt.Add((node, result.ToTypeWithAnnotations(compilation))); 3192var resultType = ResultType.ToTypeWithAnnotations(compilation); 4087arg.ToTypeWithAnnotations(compilation)); 4201placeholderBuilder.Add(CreatePlaceholderIfNecessary(expressionNoConversion, expressionType.ToTypeWithAnnotations(compilation))); 4231inferredType = TypeWithState.Create(inferredType.Type, elementState).ToTypeWithAnnotations(compilation); 4342reportRemainingWarnings: false, reportTopLevelWarnings: false).ToTypeWithAnnotations(binder.Compilation); 4739SetResult(binary, inferredResult, inferredResult.ToTypeWithAnnotations(compilation)); 5480BoundExpression consequencePlaceholder = CreatePlaceholderIfNecessary(consequence, consequenceRValue.ToTypeWithAnnotations(compilation)); 5481BoundExpression alternativePlaceholder = CreatePlaceholderIfNecessary(alternative, alternativeRValue.ToTypeWithAnnotations(compilation)); 6756SetAnalyzedNullability(discard, new VisitResult(parameterWithState, parameterWithState.ToTypeWithAnnotations(compilation)), isLvalue: true); 7138var argumentResult = visitArgumentResult.RValueType.ToTypeWithAnnotations(compilation); 7573ImmutableArray<TypeWithAnnotations> elementTypesWithAnnotations = elementTypes.SelectAsArray(a => a.ToTypeWithAnnotations(compilation)); 8599var visitResult = new VisitResult(resultType, resultType.ToTypeWithAnnotations(compilation)); 8923arguments.Add(CreatePlaceholderIfNecessary(receiverOpt, receiverType.ToTypeWithAnnotations(compilation))); 9090var lvalueType = rightState.ToTypeWithAnnotations(compilation); 9297placeholderArgs.Add(CreatePlaceholderIfNecessary(right, rightResult.ToTypeWithAnnotations(compilation))); 9513expr = CreatePlaceholderIfNecessary(expr, rightResult.ToTypeWithAnnotations(compilation)); 9596var operandTypeWithAnnotations = operandType.ToTypeWithAnnotations(compilation); 10022targetTypeWithAnnotations = resultTypeWithState.ToTypeWithAnnotations(compilation); 10069SetAnalyzedNullability(node.Expression, new VisitResult(convertedResult, convertedResult.ToTypeWithAnnotations(compilation))); 10152TypeWithAnnotations sourceType = sourceState.ToTypeWithAnnotations(compilation); 10928new VisitArgumentResult(new VisitResult(result, result.ToTypeWithAnnotations(compilation)), stateForLambda: default),
FlowAnalysis\NullableWalker_Patterns.cs (3)
349var expressionTypeWithAnnotations = expressionTypeWithState.ToTypeWithAnnotations(compilation); 644var inferredType = value.ToTypeWithAnnotations(compilation, asAnnotatedType: boundLocal.DeclarationKind == BoundLocalDeclarationKind.WithInferredType); 900placeholderBuilder.Add(CreatePlaceholderIfNecessary(expression, armType.ToTypeWithAnnotations(compilation)));
Symbols\TypeWithState.cs (1)
99ToTypeWithAnnotations(compilation, asAnnotatedType: true);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
CompilationTestUtils.cs (1)
478(annotation.IsConverted ? typeInfo.ConvertedNullability : typeInfo.Nullability).FlowState.ToInternalFlowState()).ToTypeWithAnnotations(compilation);