GetTypeExpression() public method

public GetTypeExpression ( ) : Mono.CSharp.ATypeNameExpression
return Mono.CSharp.ATypeNameExpression
Esempio n. 1
0
            public override FullNamedExpression Resolve(IMemberContext rc, bool local)
            {
                if (resolved != null || value == null)
                {
                    return(resolved);
                }

                if (local)
                {
                    return(null);
                }

                resolved = value.GetTypeExpression().ResolveAsTypeStep(rc, false);
                if (resolved == null)
                {
                    value = null;
                    return(null);
                }

                if (resolved is TypeExpr)
                {
                    resolved = resolved.ResolveAsTypeTerminal(rc, false);
                }

                return(resolved);
            }
Esempio n. 2
0
            public override FullNamedExpression Resolve(IResolveContext rc)
            {
                if (resolved != null || value == null)
                {
                    return(resolved);
                }

                resolved = value.GetTypeExpression().ResolveAsTypeStep(rc, false);
                if (resolved == null)
                {
                    value = null;
                    return(null);
                }

                TypeExpr te = resolved as TypeExpr;

                if (te != null)
                {
                    if (!te.CheckAccessLevel(rc.DeclContainer))
                    {
                        Report.SymbolRelatedToPreviousError(te.Type);
                        Expression.ErrorIsInaccesible(resolved.Location, resolved.GetSignatureForError());
                    }
                }

                return(resolved);
            }
Esempio n. 3
0
        public virtual void Define(NamespaceContainer ctx)
        {
            resolved = name.GetTypeExpression().ResolveAsTypeOrNamespace(ctx);
            var ns = resolved as Namespace;

            if (ns == null)
            {
                if (resolved != null)
                {
                    ctx.Module.Compiler.Report.SymbolRelatedToPreviousError(resolved.Type);
                    ctx.Module.Compiler.Report.Error(138, Location,
                                                     "`{0}' is a type not a namespace. A using namespace directive can only be applied to namespaces",
                                                     GetSignatureForError());
                }
            }
        }
Esempio n. 4
0
        public override FullNamedExpression Resolve(IMemberContext rc, bool local)
        {
            if (resolved != null || value == null)
            {
                return(resolved);
            }

            if (local)
            {
                return(null);
            }

            resolved = value.GetTypeExpression().ResolveAsTypeOrNamespace(rc);
            if (resolved == null)
            {
                value = null;
                return(null);
            }

            return(resolved);
        }
Esempio n. 5
0
        public Namespace Resolve(IMemberContext rc)
        {
            if (resolved != null)
            {
                return(resolved);
            }

            FullNamedExpression fne = name.GetTypeExpression().ResolveAsTypeOrNamespace(rc);

            if (fne == null)
            {
                return(null);
            }

            resolved = fne as Namespace;
            if (resolved == null)
            {
                rc.Module.Compiler.Report.SymbolRelatedToPreviousError(fne.Type);
                rc.Module.Compiler.Report.Error(138, Location,
                                                "`{0}' is a type not a namespace. A using namespace directive can only be applied to namespaces",
                                                GetSignatureForError());
            }
            return(resolved);
        }
			IReturnType ConvertReturnType (MemberName name)
			{
				return ConvertReturnType (name.GetTypeExpression ());
			}