From 23376435a1f03b80d611c5b198beafaa6fca4cc3 Mon Sep 17 00:00:00 2001 From: Victor Nova Date: Wed, 29 Dec 2021 16:59:57 -0800 Subject: [PATCH] added a regression test for https://github.com/pythonnet/pythonnet/issues/1420 closes https://github.com/pythonnet/pythonnet/issues/1420 --- src/embed_tests/Inheritance.cs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/embed_tests/Inheritance.cs b/src/embed_tests/Inheritance.cs index 950c08548..a992ee8e4 100644 --- a/src/embed_tests/Inheritance.cs +++ b/src/embed_tests/Inheritance.cs @@ -59,6 +59,14 @@ public void InheritedFromInheritedClassIsSelf() Assert.IsTrue(PythonReferenceComparer.Instance.Equals(b, bInstanceClass)); } + // https://github.com/pythonnet/pythonnet/issues/1420 + [Test] + public void CallBaseMethodFromContainerInNestedClass() + { + using var nested = new ContainerClass.InnerClass().ToPython(); + nested.InvokeMethod(nameof(ContainerClass.BaseMethod)); + } + [Test] public void Grandchild_PassesExtraBaseInstanceCheck() { @@ -183,4 +191,14 @@ public int XProp set => this.extras[nameof(this.XProp)] = value; } } + + public class ContainerClass + { + public void BaseMethod() { } + + public class InnerClass: ContainerClass + { + + } + } } pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy