MetalamaAPI documentationAspect APIMetalama.​Framework.​CodeTyped­Constant
Open sandboxFocus

TypedConstant Class

Represents a typed value that can be defined, defined to null, or undefined. Used to represent default values, for instance DefaultValue, or attribute arguments.

Inheritance
System.Object
TypedConstant
Implements
IExpression
IHasType
Namespace: Metalama.Framework.Code
Assembly: Metalama.Framework.dll
Syntax
[CompileTime]
public sealed class TypedConstant : ValueType, IExpression, IHasType

Properties

Name Description
IsInitialized

Gets a value indicating whether the Value has been specified (including when it is set to null).

IsNullOrDefault

Gets a value indicating whether the value is null or default. Not to be confused with IsInitialized.

Type

Gets the type of the value. This is important if the type is an enum, because in this case, if the enum type is not compile-time, Value is set to the underlying integer value.

Value

Gets the default value.

Values

Methods

Name Description
Create(Object)
Create(Object, IType)
Create(Object, Type)
CreateUnchecked(Object, IType)
Default(IType)
Default(Type)
ForCompilation(ICompilation)
ToString()

Explicit Interface Implementations

Name Description
IExpression.IsAssignable
IExpression.Value
IHasType.RefKind