projects
/
mono.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[mcs] Don't do constraints on fabricated generic methods. Fixes #47672
[mono.git]
/
mcs
/
mcs
/
literal.cs
diff --git
a/mcs/mcs/literal.cs
b/mcs/mcs/literal.cs
index b2efb35c1a95d74106eca17124da57f0bdd9f5a0..1af2d0c9e379ecb600379156bfe84dbf1ab67bb9 100644
(file)
--- a/
mcs/mcs/literal.cs
+++ b/
mcs/mcs/literal.cs
@@
-6,6
+6,7
@@
// Marek Safar (marek.safar@seznam.cz)
//
// Copyright 2001 Ximian, Inc.
// Marek Safar (marek.safar@seznam.cz)
//
// Copyright 2001 Ximian, Inc.
+// Copyright 2011 Xamarin Inc
//
//
// Notice that during parsing we create objects of type Literal, but the
//
//
// Notice that during parsing we create objects of type Literal, but the
@@
-49,7
+50,7
@@
namespace Mono.CSharp
{
}
{
}
- public override void Error_ValueCannotBeConverted (ResolveContext ec,
Location loc,
TypeSpec t, bool expl)
+ public override void Error_ValueCannotBeConverted (ResolveContext ec, TypeSpec t, bool expl)
{
if (t.IsGenericParameter) {
ec.Report.Error(403, loc,
{
if (t.IsGenericParameter) {
ec.Report.Error(403, loc,
@@
-60,11
+61,11
@@
namespace Mono.CSharp
if (TypeSpec.IsValueType (t)) {
ec.Report.Error(37, loc, "Cannot convert null to `{0}' because it is a value type",
if (TypeSpec.IsValueType (t)) {
ec.Report.Error(37, loc, "Cannot convert null to `{0}' because it is a value type",
-
TypeManager.CSharpName(t
));
+
t.GetSignatureForError (
));
return;
}
return;
}
- base.Error_ValueCannotBeConverted (ec,
loc,
t, expl);
+ base.Error_ValueCannotBeConverted (ec, t, expl);
}
public override string GetValueAsLiteral ()
}
public override string GetValueAsLiteral ()
@@
-94,8
+95,13
@@
namespace Mono.CSharp
}
#if FULL_AST
}
#if FULL_AST
-
char[] ILiteralConstant.
ParsedValue { get; set; }
+
public char[]
ParsedValue { get; set; }
#endif
#endif
+
+ public override object Accept (StructuralVisitor visitor)
+ {
+ return visitor.Visit (this);
+ }
}
public class CharLiteral : CharConstant, ILiteralConstant
}
public class CharLiteral : CharConstant, ILiteralConstant
@@
-110,8
+116,13
@@
namespace Mono.CSharp
}
#if FULL_AST
}
#if FULL_AST
-
char[] ILiteralConstant.
ParsedValue { get; set; }
+
public char[]
ParsedValue { get; set; }
#endif
#endif
+
+ public override object Accept (StructuralVisitor visitor)
+ {
+ return visitor.Visit (this);
+ }
}
public class IntLiteral : IntConstant, ILiteralConstant
}
public class IntLiteral : IntConstant, ILiteralConstant
@@
-126,7
+137,7
@@
namespace Mono.CSharp
//
// The 0 literal can be converted to an enum value
//
//
// The 0 literal can be converted to an enum value
//
- if (Value == 0 &&
TypeManager.IsEnumType (type)
) {
+ if (Value == 0 &&
type.IsEnum
) {
Constant c = ConvertImplicitly (EnumSpec.GetUnderlyingType (type));
if (c == null)
return null;
Constant c = ConvertImplicitly (EnumSpec.GetUnderlyingType (type));
if (c == null)
return null;
@@
-142,8
+153,13
@@
namespace Mono.CSharp
}
#if FULL_AST
}
#if FULL_AST
-
char[] ILiteralConstant.
ParsedValue { get; set; }
+
public char[]
ParsedValue { get; set; }
#endif
#endif
+
+ public override object Accept (StructuralVisitor visitor)
+ {
+ return visitor.Visit (this);
+ }
}
public class UIntLiteral : UIntConstant, ILiteralConstant
}
public class UIntLiteral : UIntConstant, ILiteralConstant
@@
-158,8
+174,13
@@
namespace Mono.CSharp
}
#if FULL_AST
}
#if FULL_AST
-
char[] ILiteralConstant.
ParsedValue { get; set; }
+
public char[]
ParsedValue { get; set; }
#endif
#endif
+
+ public override object Accept (StructuralVisitor visitor)
+ {
+ return visitor.Visit (this);
+ }
}
public class LongLiteral : LongConstant, ILiteralConstant
}
public class LongLiteral : LongConstant, ILiteralConstant
@@
-174,8
+195,13
@@
namespace Mono.CSharp
}
#if FULL_AST
}
#if FULL_AST
-
char[] ILiteralConstant.
ParsedValue { get; set; }
+
public char[]
ParsedValue { get; set; }
#endif
#endif
+
+ public override object Accept (StructuralVisitor visitor)
+ {
+ return visitor.Visit (this);
+ }
}
public class ULongLiteral : ULongConstant, ILiteralConstant
}
public class ULongLiteral : ULongConstant, ILiteralConstant
@@
-190,8
+216,13
@@
namespace Mono.CSharp
}
#if FULL_AST
}
#if FULL_AST
-
char[] ILiteralConstant.
ParsedValue { get; set; }
+
public char[]
ParsedValue { get; set; }
#endif
#endif
+
+ public override object Accept (StructuralVisitor visitor)
+ {
+ return visitor.Visit (this);
+ }
}
public class FloatLiteral : FloatConstant, ILiteralConstant
}
public class FloatLiteral : FloatConstant, ILiteralConstant
@@
-206,8
+237,13
@@
namespace Mono.CSharp
}
#if FULL_AST
}
#if FULL_AST
-
char[] ILiteralConstant.
ParsedValue { get; set; }
+
public char[]
ParsedValue { get; set; }
#endif
#endif
+
+ public override object Accept (StructuralVisitor visitor)
+ {
+ return visitor.Visit (this);
+ }
}
public class DoubleLiteral : DoubleConstant, ILiteralConstant
}
public class DoubleLiteral : DoubleConstant, ILiteralConstant
@@
-217,7
+253,7
@@
namespace Mono.CSharp
{
}
{
}
- public override void Error_ValueCannotBeConverted (ResolveContext ec,
Location loc,
TypeSpec target, bool expl)
+ public override void Error_ValueCannotBeConverted (ResolveContext ec, TypeSpec target, bool expl)
{
if (target.BuiltinType == BuiltinTypeSpec.Type.Float) {
Error_664 (ec, loc, "float", "f");
{
if (target.BuiltinType == BuiltinTypeSpec.Type.Float) {
Error_664 (ec, loc, "float", "f");
@@
-229,7
+265,7
@@
namespace Mono.CSharp
return;
}
return;
}
- base.Error_ValueCannotBeConverted (ec,
loc,
target, expl);
+ base.Error_ValueCannotBeConverted (ec, target, expl);
}
static void Error_664 (ResolveContext ec, Location loc, string type, string suffix)
}
static void Error_664 (ResolveContext ec, Location loc, string type, string suffix)
@@
-244,8
+280,13
@@
namespace Mono.CSharp
}
#if FULL_AST
}
#if FULL_AST
-
char[] ILiteralConstant.
ParsedValue { get; set; }
+
public char[]
ParsedValue { get; set; }
#endif
#endif
+
+ public override object Accept (StructuralVisitor visitor)
+ {
+ return visitor.Visit (this);
+ }
}
public class DecimalLiteral : DecimalConstant, ILiteralConstant
}
public class DecimalLiteral : DecimalConstant, ILiteralConstant
@@
-260,8
+301,13
@@
namespace Mono.CSharp
}
#if FULL_AST
}
#if FULL_AST
-
char[] ILiteralConstant.
ParsedValue { get; set; }
+
public char[]
ParsedValue { get; set; }
#endif
#endif
+
+ public override object Accept (StructuralVisitor visitor)
+ {
+ return visitor.Visit (this);
+ }
}
public class StringLiteral : StringConstant, ILiteralConstant
}
public class StringLiteral : StringConstant, ILiteralConstant
@@
-276,7
+322,12
@@
namespace Mono.CSharp
}
#if FULL_AST
}
#if FULL_AST
-
char[] ILiteralConstant.
ParsedValue { get; set; }
+
public char[]
ParsedValue { get; set; }
#endif
#endif
+
+ public override object Accept (StructuralVisitor visitor)
+ {
+ return visitor.Visit (this);
+ }
}
}
}
}