generated from JetBrains/intellij-platform-plugin-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: initial types that can hold any value should be top
- Loading branch information
Showing
4 changed files
with
78 additions
and
15 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
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
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
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,29 @@ | ||
import java.lang.invoke.MethodHandle; | ||
import java.lang.invoke.MethodHandles; | ||
import java.lang.invoke.MethodType; | ||
|
||
public class InitialTypes { | ||
|
||
void m(MethodType mt, boolean b, Inner inner) { | ||
MethodHandle mh0; | ||
if (b) { | ||
<info descr="TopMethodHandleType">mh0 = <info descr="TopMethodHandleType">MethodHandles.empty(mt)</info></info>; | ||
} else { | ||
<info descr="()int">mh0 = <info descr="()int">MethodHandles.zero(int.class)</info></info>; | ||
} | ||
<info descr="TopMethodHandleType">MethodHandle mh1 = <info descr="TopMethodHandleType">myMethodHandleMethod()</info>;</info> | ||
<info descr="TopMethodHandleType">MethodHandle mh2 = inner.methodHandle;</info> | ||
<info descr="TopMethodHandleType">MethodHandle mh3 = create().methodHandle;</info> | ||
} | ||
|
||
private MethodHandle myMethodHandleMethod() { | ||
return MethodHandles.zero(Object.class); | ||
} | ||
|
||
private Inner create() { | ||
return new Inner(); | ||
} | ||
static class Inner { | ||
MethodHandle methodHandle; | ||
} | ||
} |