// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#nullableenable
usingSystem.Collections.Immutable;
usingMicrosoft.CodeAnalysis.Text;
...
...
@@ -57,6 +59,6 @@ public interface IArrayTypeSymbol : ITypeSymbol
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#nullableenable
usingSystem.Collections.Generic;
usingMicrosoft.CodeAnalysis.Text;
...
...
@@ -57,7 +59,7 @@ public interface IAssemblySymbol : ISymbol
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#nullableenable
usingSystem.Collections.Immutable;
usingMicrosoft.CodeAnalysis.Text;
...
...
@@ -32,17 +34,17 @@ public interface IEventSymbol : ISymbol
/// <summary>
/// The 'add' accessor of the event. Null only in error scenarios.
/// </summary>
IMethodSymbolAddMethod{get;}
IMethodSymbol?AddMethod{get;}
/// <summary>
/// The 'remove' accessor of the event. Null only in error scenarios.
/// </summary>
IMethodSymbolRemoveMethod{get;}
IMethodSymbol?RemoveMethod{get;}
/// <summary>
/// The 'raise' accessor of the event. Null if there is no raise method.
/// </summary>
IMethodSymbolRaiseMethod{get;}
IMethodSymbol?RaiseMethod{get;}
/// <summary>
/// The original definition of the event. If the event is constructed from another
...
...
@@ -54,7 +56,7 @@ public interface IEventSymbol : ISymbol
/// <summary>
/// Returns the overridden event, or null.
/// </summary>
IEventSymbolOverriddenEvent{get;}
IEventSymbol?OverriddenEvent{get;}
/// <summary>
/// Returns interface properties explicitly implemented by this event.
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#nullableenable
usingSystem.Collections.Immutable;
usingMicrosoft.CodeAnalysis.Text;
...
...
@@ -21,7 +23,7 @@ public interface IFieldSymbol : ISymbol
/// Note, the set of possible associated symbols might be expanded in the future to
/// reflect changes in the languages.
/// </summary>
ISymbolAssociatedSymbol{get;}
ISymbol?AssociatedSymbol{get;}
/// <summary>
/// Returns true if this field was declared as "const" (i.e. is a constant declaration).
...
...
@@ -65,7 +67,7 @@ public interface IFieldSymbol : ISymbol
/// <summary>
/// Gets the constant value of this field
/// </summary>
objectConstantValue{get;}
object?ConstantValue{get;}
/// <summary>
/// Returns custom modifiers associated with the field, or an empty array if there are none.
...
...
@@ -88,6 +90,6 @@ public interface IFieldSymbol : ISymbol
/// This API allows matching a field that represents a named element, such as "Alice"
/// to the corresponding default element field such as "Item1"
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#nullableenable
namespaceMicrosoft.CodeAnalysis
{
/// <summary>
...
...
@@ -47,7 +49,7 @@ public interface ILocalSymbol : ISymbol
/// <summary>
/// Gets the constant value of this local variable.
/// </summary>
objectConstantValue{get;}
object?ConstantValue{get;}
/// <summary>
/// Returns true if this local variable is function return variable whose name is the function's name,
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#nullableenable
usingSystem.Collections.Immutable;
namespaceMicrosoft.CodeAnalysis
...
...
@@ -147,12 +149,12 @@ public interface IMethodSymbol : ISymbol
/// If this method overrides another method (because it both had the override modifier
/// and there correctly was a method to override), returns the overridden method.
/// </summary>
IMethodSymbolOverriddenMethod{get;}
IMethodSymbol?OverriddenMethod{get;}
/// <summary>
/// If this method can be applied to an object, returns the type of object it is applied to.
/// </summary>
ITypeSymbolReceiverType{get;}
ITypeSymbol?ReceiverType{get;}
/// <summary>
/// If this method can be applied to an object, returns the top-level nullability of the object it is applied to.
...
...
@@ -163,7 +165,7 @@ public interface IMethodSymbol : ISymbol
/// If this method is a reduced extension method, returns the definition of extension
/// method from which this was reduced. Otherwise, returns null.
/// </summary>
IMethodSymbolReducedFrom{get;}
IMethodSymbol?ReducedFrom{get;}
/// <summary>
/// If this method is a reduced extension method, returns a type inferred during reduction process for the type parameter.
...
...
@@ -173,13 +175,13 @@ public interface IMethodSymbol : ISymbol
/// <exception cref="System.InvalidOperationException">If this is not a reduced extension method.</exception>
/// <exception cref="System.ArgumentNullException">If <paramref name="reducedFromTypeParameter"/> is null.</exception>
/// <exception cref="System.ArgumentException">If <paramref name="reducedFromTypeParameter"/> doesn't belong to the corresponding <see cref="ReducedFrom"/> method.</exception>
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#nullableenable
usingMicrosoft.CodeAnalysis.Text;
usingSystem.Collections.Immutable;
...
...
@@ -23,7 +25,7 @@ public interface IModuleSymbol : ISymbol
/// <summary>
/// Given a namespace symbol, returns the corresponding module specific namespace symbol
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#nullableenable
usingSystem.Collections.Generic;
usingSystem.Collections.Immutable;
usingSystem.Reflection;
...
...
@@ -100,13 +102,13 @@ public interface INamedTypeSymbol : ITypeSymbol
/// Such a type will be classified as a delegate but its DelegateInvokeMethod
/// would be null.
/// </summary>
IMethodSymbolDelegateInvokeMethod{get;}
IMethodSymbol?DelegateInvokeMethod{get;}
/// <summary>
/// For enum types, gets the underlying type. Returns null on all other
/// kinds of types.
/// </summary>
INamedTypeSymbolEnumUnderlyingType{get;}
INamedTypeSymbol?EnumUnderlyingType{get;}
/// <summary>
/// Returns the type symbol that this type was constructed from. This type symbol
...
...
@@ -154,7 +156,7 @@ public interface INamedTypeSymbol : ITypeSymbol
/// Note, the set of possible associated symbols might be expanded in the future to
/// reflect changes in the languages.
/// </summary>
ISymbolAssociatedSymbol{get;}
ISymbol?AssociatedSymbol{get;}
/// <summary>
/// Determines if the symbol might contain extension methods.
...
...
@@ -169,7 +171,7 @@ public interface INamedTypeSymbol : ITypeSymbol
/// which is at the 8th (one based) position is always a symbol for another tuple,
/// rather than its underlying type.
/// </summary>
INamedTypeSymbolTupleUnderlyingType{get;}
INamedTypeSymbol?TupleUnderlyingType{get;}
/// <summary>
/// Returns fields that represent tuple elements for types that are tuples.
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#nullableenable
usingSystem.Collections.Generic;
usingSystem.Collections.Immutable;
usingMicrosoft.CodeAnalysis.Text;
...
...
@@ -47,7 +49,7 @@ public interface INamespaceSymbol : INamespaceOrTypeSymbol
/// <summary>
/// The containing compilation for compilation namespaces.
/// </summary>
CompilationContainingCompilation{get;}
Compilation?ContainingCompilation{get;}
/// <summary>
/// If a namespace is an assembly or compilation namespace, it may be composed of multiple
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#nullableenable
usingSystem.Collections.Immutable;
usingSystem.Runtime.InteropServices;
usingMicrosoft.CodeAnalysis.Text;
...
...
@@ -76,7 +78,7 @@ public interface IParameterSymbol : ISymbol
/// is the default value of the struct type.
/// </remarks>
/// <exception cref="System.InvalidOperationException">The parameter has no default value.</exception>
objectExplicitDefaultValue{get;}
object?ExplicitDefaultValue{get;}
/// <summary>
/// Get the original definition of this symbol. If this symbol is derived from another
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#nullableenable
usingSystem.Collections.Immutable;
usingMicrosoft.CodeAnalysis.Text;
...
...
@@ -67,12 +69,12 @@ public interface IPropertySymbol : ISymbol
/// <summary>
/// The 'get' accessor of the property, or null if the property is write-only.
/// </summary>
IMethodSymbolGetMethod{get;}
IMethodSymbol?GetMethod{get;}
/// <summary>
/// The 'set' accessor of the property, or null if the property is read-only.
/// </summary>
IMethodSymbolSetMethod{get;}
IMethodSymbol?SetMethod{get;}
/// <summary>
/// The original definition of the property. If the property is constructed from another
...
...
@@ -84,7 +86,7 @@ public interface IPropertySymbol : ISymbol
/// <summary>
/// Returns the overridden property, or null.
/// </summary>
IPropertySymbolOverriddenProperty{get;}
IPropertySymbol?OverriddenProperty{get;}
/// <summary>
/// Returns interface properties explicitly implemented by this property.
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#nullableenable
namespaceMicrosoft.CodeAnalysis.Symbols
{
internalinterfaceISymbolInternal:ISymbol
{
#nullabledisable// Skipped for now https://github.com/dotnet/roslyn/issues/39166
CompilationDeclaringCompilation{get;}
#nullableenable
/// <summary>
/// Allows a symbol to support comparisons that involve child type symbols
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#nullableenable
usingSystem.Collections.Immutable;
namespaceMicrosoft.CodeAnalysis
...
...
@@ -33,12 +35,12 @@ public interface ITypeParameterSymbol : ITypeSymbol
/// <summary>
/// The method that declares the type parameter, or null.
/// </summary>
IMethodSymbolDeclaringMethod{get;}
IMethodSymbol?DeclaringMethod{get;}
/// <summary>
/// The type that declares the type parameter, or null.
/// </summary>
INamedTypeSymbolDeclaringType{get;}
INamedTypeSymbol?DeclaringType{get;}
/// <summary>
/// True if the reference type constraint (<c>class</c>) was specified for the type parameter.
...
...
@@ -94,6 +96,6 @@ public interface ITypeParameterSymbol : ITypeSymbol
/// If this is a type parameter of a reduced extension method, gets the type parameter definition that
/// this type parameter was reduced from. Otherwise, returns Nothing.
// Copyright (c) Microsoft. All Rights Reserved. Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information.
#nullableenable
usingSystem;
usingSystem.Collections.Generic;
usingSystem.Collections.Immutable;
usingSystem.Diagnostics;
usingSystem.Diagnostics.CodeAnalysis;
namespaceMicrosoft.CodeAnalysis
{
...
...
@@ -26,7 +29,7 @@ public interface ITypeSymbol : INamespaceOrTypeSymbol
/// and pointer types do not have a base type. The base type of a type parameter
/// is its effective base class.
/// </summary>
INamedTypeSymbolBaseType{get;}
INamedTypeSymbol?BaseType{get;}
/// <summary>
/// Gets the set of interfaces that this type directly implements. This set does not include
...
...
@@ -95,7 +98,7 @@ public interface ITypeSymbol : INamespaceOrTypeSymbol
/// <param name="interfaceMember">
/// Must be a non-null interface property, method, or event.