ICSharpCode.NRefactory.MonoCSharp.NullLiteral.Error_ValueCannotBeConverted C# (CSharp) 메소드

Error_ValueCannotBeConverted() 공개 메소드

public Error_ValueCannotBeConverted ( ICSharpCode.NRefactory.MonoCSharp.ResolveContext ec, TypeSpec t, bool expl ) : void
ec ICSharpCode.NRefactory.MonoCSharp.ResolveContext
t TypeSpec
expl bool
리턴 void
		public override void Error_ValueCannotBeConverted (ResolveContext ec, TypeSpec t, bool expl)
		{
			if (t.IsGenericParameter) {
				ec.Report.Error(403, loc,
					"Cannot convert null to the type parameter `{0}' because it could be a value " +
					"type. Consider using `default ({0})' instead", t.Name);
				return;
			}

			if (TypeSpec.IsValueType (t)) {
				ec.Report.Error(37, loc, "Cannot convert null to `{0}' because it is a value type",
					t.GetSignatureForError ());
				return;
			}

			base.Error_ValueCannotBeConverted (ec, t, expl);
		}