public void SetBaseType(AstTypeReference typeReference) { if (!TrySetBaseType(typeReference)) { throw new InternalErrorException( "Base Type Reference already set or null."); } }
protected AstTypeReference(AstTypeReference typeToCopy) : base(AstNodeKind.Type) { Context = typeToCopy.Context; if (typeToCopy.HasIdentifier) { this.SetIdentifier(typeToCopy.Identifier.MakeCopy()); } if (typeToCopy.HasSymbol) { TrySetSymbol(typeToCopy.Symbol); } IsInferred = typeToCopy.IsInferred; }
public static int Rank(AstTypeReference source, AstTypeReference target) { var sourceName = source.Identifier.SymbolName.CanonicalName.FullName; var targetName = target.Identifier.SymbolName.CanonicalName.FullName; if (sourceName == targetName) { return(100); } if (_typeRanks.TryGetValue($"{sourceName}-{targetName}", out int rank)) { return(rank); } return(-100); }
public static AstMessage InvalidEnumBaseType(this AstErrorSite errorSite, AstTypeReference type) { return(errorSite.AddError(type, type.Context !, $"Specified Type is not valid as an Enum Base Type: '{type.Identifier.NativeFullName}'")); }
public static AstMessage UndefinedType(this AstErrorSite errorSite, AstTypeReference type) { return(errorSite.AddError(type, type.Context !, $"Reference to an undefined Type '{type.Identifier.NativeFullName}'")); }
public AstTemplateParameterArgument(AstTypeReference typeReference) { this.SetTypeReference(typeReference); }