projects
/
mono.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #642 from Ventero/CleanCopyLocal
[mono.git]
/
mcs
/
mcs
/
pending.cs
diff --git
a/mcs/mcs/pending.cs
b/mcs/mcs/pending.cs
index 7684c117c04c0c346ed7b96f59d261dbcc1a572b..af15bf6e1c932ff3be8f3c3fd19f32a3f008bef0 100644
(file)
--- a/
mcs/mcs/pending.cs
+++ b/
mcs/mcs/pending.cs
@@
-192,17
+192,17
@@
namespace Mono.CSharp {
static MissingInterfacesInfo [] GetMissingInterfaces (TypeDefinition container)
{
//
static MissingInterfacesInfo [] GetMissingInterfaces (TypeDefinition container)
{
//
- //
Notice that Interfaces will only return the interfaces that the Type
- // i
s supposed to implement, not all the interfaces that the type implements.
+ //
Interfaces will return all interfaces that the container
+ // i
mplements including any inherited interfaces
//
var impl = container.Definition.Interfaces;
if (impl == null || impl.Count == 0)
return EmptyMissingInterfacesInfo;
//
var impl = container.Definition.Interfaces;
if (impl == null || impl.Count == 0)
return EmptyMissingInterfacesInfo;
-
MissingInterfacesInfo[]
ret = new MissingInterfacesInfo[impl.Count];
+
var
ret = new MissingInterfacesInfo[impl.Count];
- for (int i = 0; i <
impl.Count
; i++)
+ for (int i = 0; i <
ret.Length
; i++)
ret [i] = new MissingInterfacesInfo (impl [i]);
// we really should not get here because Object doesnt implement any
ret [i] = new MissingInterfacesInfo (impl [i]);
// we really should not get here because Object doesnt implement any
@@
-534,10
+534,14
@@
namespace Mono.CSharp {
// about mismatch at return type when the check bellow rejects them
//
var parameters = mi.Parameters;
// about mismatch at return type when the check bellow rejects them
//
var parameters = mi.Parameters;
+ MethodSpec close_match = null;
+
while (true) {
var candidates = MemberCache.FindMembers (base_type, mi.Name, false);
while (true) {
var candidates = MemberCache.FindMembers (base_type, mi.Name, false);
- if (candidates == null)
+ if (candidates == null) {
+ base_method = close_match;
return false;
return false;
+ }
MethodSpec similar_candidate = null;
foreach (var candidate in candidates) {
MethodSpec similar_candidate = null;
foreach (var candidate in candidates) {
@@
-590,19
+594,29
@@
namespace Mono.CSharp {
// From this point the candidate is used for detailed error reporting
// because it's very close match to what we are looking for
//
// From this point the candidate is used for detailed error reporting
// because it's very close match to what we are looking for
//
- base_method = (MethodSpec) candidate;
+ var m = (MethodSpec) candidate;
+
+ if (!m.IsPublic) {
+ if (close_match == null)
+ close_match = m;
- if (!candidate.IsPublic)
- return false;
+ continue;
+ }
- if (!TypeSpecComparer.Override.IsEqual (mi.ReturnType, base_method.ReturnType))
- return false;
+ if (!TypeSpecComparer.Override.IsEqual (mi.ReturnType, m.ReturnType)) {
+ if (close_match == null)
+ close_match = m;
- if (mi.IsGeneric && !Method.CheckImplementingMethodConstraints (container, base_method, mi)) {
+ continue;
+ }
+
+ base_method = m;
+
+ if (mi.IsGeneric && !Method.CheckImplementingMethodConstraints (container, m, mi)) {
return true;
}
}
return true;
}
}
-
+
if (base_method != null) {
if (similar_candidate != null) {
Report.SymbolRelatedToPreviousError (similar_candidate);
if (base_method != null) {
if (similar_candidate != null) {
Report.SymbolRelatedToPreviousError (similar_candidate);
@@
-617,8
+631,10
@@
namespace Mono.CSharp {
}
base_type = candidates[0].DeclaringType.BaseType;
}
base_type = candidates[0].DeclaringType.BaseType;
- if (base_type == null)
+ if (base_type == null) {
+ base_method = close_match;
return false;
return false;
+ }
}
if (!base_method.IsVirtual) {
}
if (!base_method.IsVirtual) {