39 references to ToTypeWithAnnotations
Microsoft.CodeAnalysis.CSharp (38)
Binder\Binder_Patterns.cs (1)
1739var declType = TypeWithState.ForType(inputType).ToTypeWithAnnotations(Compilation);
FlowAnalysis\NullableWalker.cs (32)
323SetResult(expression, resultType: type, lvalueType: type.ToTypeWithAnnotations(compilation), updateAnalyzedNullability: updateAnalyzedNullability); 328SetAnalyzedNullability(expression, resultType: type, lvalueType: type.ToTypeWithAnnotations(compilation)); 336VisitResult visitResult = _visitResult.WithLValueType(ResultType.ToTypeWithAnnotations(compilation)); 358private void SetInvalidResult() => SetResult(expression: null, _invalidType, _invalidType.ToTypeWithAnnotations(compilation), updateAnalyzedNullability: false); 3106_returnTypesOpt.Add((node, result.ToTypeWithAnnotations(compilation))); 3574var resultType = ResultType.ToTypeWithAnnotations(compilation); 4920var lvalueType = resultType.ToTypeWithAnnotations(compilation); 4998arg.ToTypeWithAnnotations(compilation)); 5112placeholderBuilder.Add(CreatePlaceholderIfNecessary(expressionNoConversion, expressionType.ToTypeWithAnnotations(compilation))); 5141inferredType = TypeWithState.Create(inferredType.Type, elementState).ToTypeWithAnnotations(compilation); 5251reportRemainingWarnings: false, reportTopLevelWarnings: false).ToTypeWithAnnotations(binder.Compilation); 5573SetResult(binary, inferredResult, inferredResult.ToTypeWithAnnotations(compilation)); 5691[new BoundExpressionWithNullability(leftOperand.Syntax, leftOperand, leftUnderlyingType.ToTypeWithAnnotations(compilation).NullableAnnotation, leftUnderlyingType.Type), 5692new BoundExpressionWithNullability(rightOperand.Syntax, rightOperand, rightUnderlyingType.ToTypeWithAnnotations(compilation).NullableAnnotation, rightUnderlyingType.Type)], 6527BoundExpression consequencePlaceholder = CreatePlaceholderIfNecessary(consequence, consequenceRValue.ToTypeWithAnnotations(compilation)); 6528BoundExpression alternativePlaceholder = CreatePlaceholderIfNecessary(alternative, alternativeRValue.ToTypeWithAnnotations(compilation)); 8357SetAnalyzedNullability(discard, new VisitResult(parameterWithState, parameterWithState.ToTypeWithAnnotations(compilation)), isLvalue: true); 8875var argumentType = visitResult.RValueType.ToTypeWithAnnotations(compilation); 9350ImmutableArray<TypeWithAnnotations> elementTypesWithAnnotations = elementTypes.SelectAsArray(a => a.ToTypeWithAnnotations(compilation)); 10632SetAnalyzedNullability(sourceToParameterConversion, new VisitResult(operandType, operandType.ToTypeWithAnnotations(compilation))); 10641SetAnalyzedNullability(unionConstructionConversion, new VisitResult(unionTypeWithState, unionTypeWithState.ToTypeWithAnnotations(compilation))); 10699var visitResult = new VisitResult(resultType, resultType.ToTypeWithAnnotations(compilation)); 11034arguments.Add(CreatePlaceholderIfNecessary(receiverOpt, receiverType.ToTypeWithAnnotations(compilation))); 11209var lvalueType = rightState.ToTypeWithAnnotations(compilation); 11415placeholderArgs.Add(CreatePlaceholderIfNecessary(right, rightResult.ToTypeWithAnnotations(compilation))); 11635expr = CreatePlaceholderIfNecessary(expr, rightResult.ToTypeWithAnnotations(compilation)); 11807var operandTypeWithAnnotations = operandType.ToTypeWithAnnotations(compilation); 12375targetTypeWithAnnotations = resultTypeWithState.ToTypeWithAnnotations(compilation); 12425SetAnalyzedNullability(collectionExpression, new VisitResult(convertedResult, convertedResult.ToTypeWithAnnotations(compilation))); 12515TypeWithAnnotations sourceType = sourceState.ToTypeWithAnnotations(compilation); 12769[new BoundExpressionWithNullability(operand.Syntax, operand, operandType.ToTypeWithAnnotations(compilation).NullableAnnotation, operandType.Type)], 13400new VisitResult(result, result.ToTypeWithAnnotations(compilation)),
FlowAnalysis\NullableWalker_Patterns.cs (4)
387var expressionTypeWithAnnotations = expressionTypeWithState.ToTypeWithAnnotations(compilation); 524TrackNullableStateForAssignment(valueOpt: null, inputTypeWithState.ToTypeWithAnnotations(compilation), outputSlot, inputTypeWithState, inputSlot); 631var inferredType = value.ToTypeWithAnnotations(compilation, asAnnotatedType: boundLocal.DeclarationKind == BoundLocalDeclarationKind.WithInferredType); 1042placeholderBuilder.Add(CreatePlaceholderIfNecessary(expression, armType.ToTypeWithAnnotations(compilation)));
Symbols\TypeWithState.cs (1)
99ToTypeWithAnnotations(compilation, asAnnotatedType: true);
Microsoft.CodeAnalysis.CSharp.Test.Utilities (1)
CompilationTestUtils.cs (1)
485(annotation.IsConverted ? typeInfo.ConvertedNullability : typeInfo.Nullability).FlowState.ToInternalFlowState()).ToTypeWithAnnotations(compilation);