Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit882ccb6

Browse files
committed
DRAFT: only use a single overload automatically, require explicit call otherwise
1 parentc4325dd commit882ccb6

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

‎src/runtime/MethodBinder.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,10 +516,14 @@ public MismatchedMethod(Exception exception, MethodBase mb)
516516
// type of the arguments and use it to construct the correct method.
517517
Type[]?types=Runtime.PythonArgsToTypeArray(args,true);
518518
MethodInfo[]overloads=MatchParameters(methods,types);
519-
if(overloads.Length!=0)
519+
if(overloads.Length==1)
520520
{
521521
returnBind(inst,args,kwargDict,overloads,matchGenerics:false);
522522
}
523+
else
524+
{
525+
Exceptions.RaiseTypeError("Ambiguous overload");
526+
}
523527
}
524528
if(mismatchedMethods.Count>0)
525529
{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp