Example #1
0
        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);
        }
Example #2
0
 internal ParameterDeclarationNode(Token identifier, TypeClauseNode type)
 {
     ParameterName = identifier ?? throw new ArgumentNullException(nameof(identifier));
     Type          = type ?? throw new ArgumentNullException(nameof(type));
 }
Example #3
0
        // 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.
        }