Skip to content

Commit 2805229

Browse files
committed
Resolve ambiguous methods with object and inherited from object parameters
1 parent 8e68d4a commit 2805229

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

Jurassic/Compiler/Binders/BinderUtilities.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,12 @@ public static int ResolveOverloads(RuntimeMethodHandle[] methodHandles, ScriptEn
111111
{
112112
demeritPoints[i] += disqualification;
113113
}
114+
else if (outputType != input.GetType())
115+
{
116+
// To fix ambiguous when the parameter is of type object and there is another method
117+
// with parameter which inherits object.
118+
demeritPoints[i]++;
119+
}
114120
break;
115121

116122

0 commit comments

Comments
 (0)