protected sealed override ITypeSymbol CreateITypeSymbol( CodeAnalysis.NullableAnnotation nullableAnnotation ) { Debug.Assert(nullableAnnotation != DefaultNullableAnnotation); return(new PublicModel.DynamicTypeSymbol(this, nullableAnnotation)); }
public NonErrorNamedTypeSymbol(Symbols.NamedTypeSymbol underlying, CodeAnalysis.NullableAnnotation nullableAnnotation) : base(nullableAnnotation) { Debug.Assert(underlying is object); Debug.Assert(!underlying.IsErrorType()); _underlying = underlying; }
public static string ToDisplayString( ITypeSymbol symbol, CodeAnalysis.NullableAnnotation nullableAnnotation, SymbolDisplayFormat format = null) { return(ToDisplayParts(symbol, nullableAnnotation, format).ToDisplayString()); }
protected override ITypeSymbol WithNullableAnnotation( CodeAnalysis.NullableAnnotation nullableAnnotation ) { Debug.Assert(nullableAnnotation != _underlying.DefaultNullableAnnotation); Debug.Assert(nullableAnnotation != this.NullableAnnotation); return(new ErrorTypeSymbol(_underlying, nullableAnnotation)); }
public ErrorTypeSymbol( Symbols.ErrorTypeSymbol underlying, CodeAnalysis.NullableAnnotation nullableAnnotation ) : base(nullableAnnotation) { RoslynDebug.Assert(underlying is object); _underlying = underlying; }
public TypeParameterSymbol( Symbols.TypeParameterSymbol underlying, CodeAnalysis.NullableAnnotation nullableAnnotation ) : base(nullableAnnotation) { Debug.Assert(underlying is object); _underlying = underlying; }
public PointerTypeSymbol( Symbols.PointerTypeSymbol underlying, CodeAnalysis.NullableAnnotation nullableAnnotation ) : base(nullableAnnotation) { Debug.Assert(underlying is object); _underlying = underlying; }
public static string ToMinimalDisplayString( ITypeSymbol symbol, CodeAnalysis.NullableAnnotation nullableAnnotation, SemanticModel semanticModel, int position, SymbolDisplayFormat format = null) { return(ToMinimalDisplayParts(symbol, nullableAnnotation, semanticModel, position, format).ToDisplayString()); }
public static ImmutableArray <SymbolDisplayPart> ToMinimalDisplayParts( ITypeSymbol symbol, CodeAnalysis.NullableAnnotation nullableAnnotation, SemanticModel semanticModel, int position, SymbolDisplayFormat format = null) { format ??= SymbolDisplayFormat.MinimallyQualifiedFormat; return(ToDisplayParts(symbol.WithNullableAnnotation(nullableAnnotation), semanticModel, position, format, minimal: true)); }
public static ImmutableArray <SymbolDisplayPart> ToDisplayParts( ITypeSymbol symbol, CodeAnalysis.NullableAnnotation nullableAnnotation, SymbolDisplayFormat format = null) { // null indicates the default format format ??= SymbolDisplayFormat.CSharpErrorMessageFormat; return(ToDisplayParts( symbol.WithNullableAnnotation(nullableAnnotation), semanticModelOpt: null, positionOpt: -1, format: format, minimal: false)); }
ITypeSymbol ITypeSymbol.WithNullableAnnotation(CodeAnalysis.NullableAnnotation nullableAnnotation) { if (NullableAnnotation == nullableAnnotation) { return(this); } else if (nullableAnnotation == UnderlyingTypeSymbol.DefaultNullableAnnotation) { return((ITypeSymbol)UnderlyingSymbol.ISymbol); } return(WithNullableAnnotation(nullableAnnotation)); }
private static void VerifyDiscardParameterSymbol( ParameterSyntax underscore, string expectedType, CodeAnalysis.NullableAnnotation expectedAnnotation, SemanticModel model ) { Assert.Null(model.GetSymbolInfo(underscore).Symbol); var symbol1 = model.GetDeclaredSymbol(underscore); Assert.Equal(expectedType, symbol1.Type.ToTestDisplayString()); Assert.Equal("_", symbol1.Name); Assert.True(symbol1.IsDiscard); Assert.Equal(expectedType, symbol1.Type.ToTestDisplayString()); Assert.Equal(expectedAnnotation, symbol1.NullableAnnotation); }
protected override ITypeSymbol CreateITypeSymbol(CodeAnalysis.NullableAnnotation nullableAnnotation) => throw ExceptionUtilities.Unreachable;
public NamedTypeSymbol(CodeAnalysis.NullableAnnotation nullableAnnotation = CodeAnalysis.NullableAnnotation.None) : base(nullableAnnotation) { }
protected abstract ITypeSymbol WithNullableAnnotation(CodeAnalysis.NullableAnnotation nullableAnnotation);
protected TypeSymbol(CodeAnalysis.NullableAnnotation nullableAnnotation) { NullableAnnotation = nullableAnnotation; }