示例#1
0
        public Expression TypeCheck(Name name, Scope scope)
        {
            var position   = name.Position;
            var identifier = name.Identifier;

            DataType type;

            if (scope.TryGet(identifier, out type))
            {
                return(new Name(position, identifier, type.FreshenGenericTypeVariables()));
            }

            LogError(CompilerError.UndefinedIdentifier(name));
            return(name);
        }