private TypeSymbol BindTypeClause(TypeClauseNode node) { if (node == null) { return(null); } if (Scope.TryLookupType(node.TypeName.Text, out var type)) { return(type); } diagnostics.ReportUndefinedType(node.TypeName, node.TypeName.Text); return(null); }
internal ParameterDeclarationNode(Token identifier, TypeClauseNode type) { ParameterName = identifier ?? throw new ArgumentNullException(nameof(identifier)); Type = type ?? throw new ArgumentNullException(nameof(type)); }
// NB: either type or initializer may be null, but not bith at the same time. internal VariableDeclarationNode(Token identifier, TypeClauseNode type, ExpressionNode initializer) { VariableName = identifier ?? throw new ArgumentNullException(nameof(identifier)); Type = type; // may be null. Initializer = initializer; // may be null. }