Skip to content

DLR-based overload resolution #1278

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
Closed
Changes from 1 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
Prev Previous commit
Next Next commit
fixed TestDomainReload to not call static method using object instance
  • Loading branch information
lostmsu committed Nov 12, 2020
commit 7cb7cfa1aacde710c1c97ad295ca766e562ab59b
10 changes: 6 additions & 4 deletions src/embed_tests/TestDomainReload.cs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ import clr
from Python.EmbeddingTest.Domain import MyClass
obj = MyClass()
obj.Method()
obj.StaticMethod()
MyClass.StaticMethod()
obj.Property = 1
obj.Field = 10
", Assembly.GetExecutingAssembly().FullName);
Expand Down Expand Up @@ -137,16 +137,18 @@ public override ValueType Execute(ValueType arg)
Assert.That(tp_clear, Is.Not.Null);

using (PyObject obj = new PyObject(handle))
using (PyObject myClass = new PyObject(new BorrowedReference(tp)))
{
obj.InvokeMethod("Method");
obj.InvokeMethod("StaticMethod");
myClass.InvokeMethod("StaticMethod");

using (var scope = Py.CreateScope())
{
scope.Set("obj", obj);
scope.Set("myClass", myClass);
scope.Exec(@"
obj.Method()
obj.StaticMethod()
myClass.StaticMethod()
obj.Property += 1
obj.Field += 10
");
Expand Down Expand Up @@ -191,7 +193,7 @@ from Python.EmbeddingTest.Domain import MyClass
def test_obj_call():
obj = MyClass()
obj.Method()
obj.StaticMethod()
MyClass.StaticMethod()
obj.Property = 1
obj.Field = 10

Expand Down