當前位置: 首頁>>代碼示例>>C#>>正文


C# Expression.GetSignatureForError方法代碼示例

本文整理匯總了C#中Mono.CSharp.Expression.GetSignatureForError方法的典型用法代碼示例。如果您正苦於以下問題:C# Expression.GetSignatureForError方法的具體用法?C# Expression.GetSignatureForError怎麽用?C# Expression.GetSignatureForError使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Mono.CSharp.Expression的用法示例。


在下文中一共展示了Expression.GetSignatureForError方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Error_ConversionFailed

		void Error_ConversionFailed (ResolveContext ec, MethodSpec method, Expression return_type)
		{
			var invoke_method = Delegate.GetInvokeMethod (type);
			string member_name = method_group.InstanceExpression != null ?
				Delegate.FullDelegateDesc (method) :
				TypeManager.GetFullNameSignature (method);

			ec.Report.SymbolRelatedToPreviousError (type);
			ec.Report.SymbolRelatedToPreviousError (method);
			if (ec.Module.Compiler.Settings.Version == LanguageVersion.ISO_1) {
				ec.Report.Error (410, loc, "A method or delegate `{0} {1}' parameters and return type must be same as delegate `{2} {3}' parameters and return type",
					method.ReturnType.GetSignatureForError (), member_name,
					invoke_method.ReturnType.GetSignatureForError (), Delegate.FullDelegateDesc (invoke_method));
				return;
			}

			if (return_type == null) {
				ec.Report.Error (123, loc, "A method or delegate `{0}' parameters do not match delegate `{1}' parameters",
					member_name, Delegate.FullDelegateDesc (invoke_method));
				return;
			}

			ec.Report.Error (407, loc, "A method or delegate `{0} {1}' return type does not match delegate `{2} {3}' return type",
				return_type.GetSignatureForError (), member_name,
				invoke_method.ReturnType.GetSignatureForError (), Delegate.FullDelegateDesc (invoke_method));
		}
開發者ID:psni,項目名稱:mono,代碼行數:26,代碼來源:delegate.cs

示例2: InferType

        public bool InferType(ResolveContext ec, Expression right_side)
        {
            if (type != null)
                throw new InternalErrorException ("An implicitly typed local variable could not be redefined");

            type = right_side.Type;
            if (type == TypeManager.null_type || type == TypeManager.void_type || type == InternalType.AnonymousMethod || type == InternalType.MethodGroup) {
                ec.Report.Error (815, loc, "An implicitly typed local variable declaration cannot be initialized with `{0}'",
                              right_side.GetSignatureForError ());
                return false;
            }

            eclass = ExprClass.Variable;
            return true;
        }
開發者ID:speier,項目名稱:shake,代碼行數:15,代碼來源:ecore.cs

示例3: Error_IsNotConvertibleToIDisposable

		static public void Error_IsNotConvertibleToIDisposable (Expression expr)
		{
			Report.SymbolRelatedToPreviousError (expr.Type);
			Report.Error (1674, expr.Location, "`{0}': type used in a using statement must be implicitly convertible to `System.IDisposable'",
				expr.GetSignatureForError ());
		}
開發者ID:lewurm,項目名稱:benchmarker,代碼行數:6,代碼來源:statement.cs

示例4: ResolveMemberAccess

        public virtual MemberExpr ResolveMemberAccess(ResolveContext ec, Expression left, Location loc,
            SimpleName original)
        {
            //
            // Precondition:
            //   original == null || original.Resolve (...) ==> left
            //

            if (left is TypeExpr) {
                left = ((TypeExpr) left).ResolveAsTypeTerminal (ec, false);
                if (left == null)
                    return null;

                // TODO: Same problem as in class.cs, TypeTerminal does not
                // always do all necessary checks
                ObsoleteAttribute oa = left.Type.GetAttributeObsolete ();
                if (oa != null && !ec.IsObsolete) {
                    AttributeTester.Report_ObsoleteMessage (oa, left.GetSignatureForError (), loc, ec.Report);
                }

            //				GenericTypeExpr ct = left as GenericTypeExpr;
            //				if (ct != null && !ct.CheckConstraints (ec))
            //					return null;
                //

                if (!IsStatic) {
                    SimpleName.Error_ObjectRefRequired (ec, loc, GetSignatureForError ());
                    return null;
                }

                return this;
            }

            if (!IsInstance) {
                if (original != null && original.IdenticalNameAndTypeName (ec, left, loc))
                    return this;

                return ResolveExtensionMemberAccess (ec, left);
            }

            InstanceExpression = left;
            return this;
        }
開發者ID:speier,項目名稱:shake,代碼行數:43,代碼來源:ecore.cs

示例5: Error_ConversionFailed

		void Error_ConversionFailed (ResolveContext ec, MethodBase method, Expression return_type)
		{
			MethodInfo invoke_method = Delegate.GetInvokeMethod (ec.Compiler, ec.CurrentType, type);
			string member_name = delegate_instance_expression != null ?
				Delegate.FullDelegateDesc (method) :
				TypeManager.GetFullNameSignature (method);

			ec.Report.SymbolRelatedToPreviousError (type);
			ec.Report.SymbolRelatedToPreviousError (method);
			if (RootContext.Version == LanguageVersion.ISO_1) {
				ec.Report.Error (410, loc, "A method or delegate `{0} {1}' parameters and return type must be same as delegate `{2} {3}' parameters and return type",
					TypeManager.CSharpName (((MethodInfo) method).ReturnType), member_name,
					TypeManager.CSharpName (invoke_method.ReturnType), Delegate.FullDelegateDesc (invoke_method));
				return;
			}
			if (return_type == null) {
				ec.Report.Error (123, loc, "A method or delegate `{0}' parameters do not match delegate `{1}' parameters",
					member_name, Delegate.FullDelegateDesc (invoke_method));
				return;
			}

			ec.Report.Error (407, loc, "A method or delegate `{0} {1}' return type does not match delegate `{2} {3}' return type",
				return_type.GetSignatureForError (), member_name,
				TypeManager.CSharpName (invoke_method.ReturnType), Delegate.FullDelegateDesc (invoke_method));
		}
開發者ID:calumjiao,項目名稱:Mono-Class-Libraries,代碼行數:25,代碼來源:delegate.cs


注:本文中的Mono.CSharp.Expression.GetSignatureForError方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。