Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'mcs/gmcs/generic.cs')
-rw-r--r--mcs/gmcs/generic.cs19
1 files changed, 8 insertions, 11 deletions
diff --git a/mcs/gmcs/generic.cs b/mcs/gmcs/generic.cs
index 1ba9fb80e8d..62f368e195d 100644
--- a/mcs/gmcs/generic.cs
+++ b/mcs/gmcs/generic.cs
@@ -620,10 +620,6 @@ namespace Mono.CSharp {
get { return constraints; }
}
- public bool HasConstructorConstraint {
- get { return constraints != null && constraints.HasConstructorConstraint; }
- }
-
public DeclSpace DeclSpace {
get { return decl; }
}
@@ -930,9 +926,6 @@ namespace Mono.CSharp {
MemberList list = TypeManager.FindMembers (
gc.ClassConstraint, mt, bf, filter, criteria);
- Report.Debug (128, "TPARAM FIND MEMBERS #1", Name, mt, bf,
- filter, criteria, gc.ClassConstraint, list.Count);
-
members.AddRange (list);
}
@@ -1655,7 +1648,7 @@ namespace Mono.CSharp {
if (TypeManager.IsBuiltinType (atype) || atype.IsValueType)
return true;
- if (HasDefaultConstructor (ec.DeclContainer.TypeBuilder, atype))
+ if (HasDefaultConstructor (atype))
return true;
Report_SymbolRelatedToPreviousError ();
@@ -1704,7 +1697,7 @@ namespace Mono.CSharp {
return false;
}
- bool HasDefaultConstructor (Type containerType, Type atype)
+ bool HasDefaultConstructor (Type atype)
{
if (atype.IsAbstract)
return false;
@@ -1732,8 +1725,12 @@ namespace Mono.CSharp {
}
TypeParameter tparam = TypeManager.LookupTypeParameter (atype);
- if (tparam != null)
- return tparam.HasConstructorConstraint;
+ if (tparam != null) {
+ if (tparam.GenericConstraints == null)
+ return false;
+ else
+ return tparam.GenericConstraints.HasConstructorConstraint;
+ }
MemberList list = TypeManager.FindMembers (
atype, MemberTypes.Constructor,