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

2574 StackOverflow Exception On Super Method Call Fix#2628

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
rmadsen-ks wants to merge3 commits intopythonnet:master
base:master
Choose a base branch
Loading
fromrmadsen-ks:2574-StackOverFlowExceptionOnSuperMethodCallFix
Open
Show file tree
Hide file tree
Changes from1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
PrevPrevious commit
NextNext commit
Added fix for calling virtual method on baseclass which is not defined.
  • Loading branch information
@rmadsen-ks@filmor
rmadsen-ks authored andfilmor committedDec 8, 2025
commit0c995516ac3066d6143fd33956a49a527a04ada7
2 changes: 1 addition & 1 deletionsrc/runtime/Types/ClassDerived.cs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -396,7 +396,7 @@ private static void AddVirtualMethod(MethodInfo method, Type baseType, TypeBuild
string? baseMethodName = null;
if (!method.IsAbstract)
{
baseMethodName = "_" +baseType.Name + "__" + method.Name;
baseMethodName = "_" +method.DeclaringType.Name + "__" + method.Name;
MethodBuilder baseMethodBuilder = typeBuilder.DefineMethod(baseMethodName,
MethodAttributes.Public |
MethodAttributes.Final |
Expand Down
5 changes: 5 additions & 0 deletionssrc/testing/classtest.cs
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -76,4 +76,9 @@ public virtual string SayGoodbye()
return "!";
}
}

public class SimpleClass2 : SimpleClass
{
// this class does not override SayGoodbye.
}
}
4 changes: 2 additions & 2 deletionstests/test_subclass.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -9,7 +9,7 @@
import System
import pytest
from Python.Test import (IInterfaceTest, SubClassTest, EventArgsTest,
FunctionsTest, IGenericInterface, GenericVirtualMethodTest, SimpleClass, ISayHello1)
FunctionsTest, IGenericInterface, GenericVirtualMethodTest, SimpleClass,SimpleClass2,ISayHello1)
from System.Collections.Generic import List


Expand DownExpand Up@@ -355,7 +355,7 @@ def test_multi_level_subclass():
exception if a method was not implemented in the middle of the tree.
"""
import clr
class DualSubClass0(ISayHello1,SimpleClass):
class DualSubClass0(ISayHello1,SimpleClass2):
__namespace__ = "Test"
def SayHello(self):
return "hello"
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp