-
-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add a new test to verify we can reflect invoke toString on a string. …
…The uniqueness here is that java.lang.Object.toString is remapped to a static method. Fix an issue with how we were invoking remapped methods. The Java reflection information lists the method as an instance method. But it's actually remapped to a static method. Same calling convention, but it turns from a callvirt into a call. This was handled through mw.EmitCallvirtReflect, which got removed in the restriction of ReflectionFactory. fixes #647
- Loading branch information
Showing
2 changed files
with
24 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
package ikvm.tests.java.java.lang.reflect; | ||
|
||
import java.lang.reflect.*; | ||
|
||
@cli.Microsoft.VisualStudio.TestTools.UnitTesting.TestClassAttribute.Annotation() | ||
public class StringTests { | ||
|
||
@cli.Microsoft.VisualStudio.TestTools.UnitTesting.TestMethodAttribute.Annotation() | ||
public void canInvokeToStringOnString() throws Throwable { | ||
String test = "test"; | ||
test.getClass().getMethod("toString").invoke(test); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters