-
Bug
-
Resolution: Fixed
-
P4
-
9
Correct behavior:
bitter_fox@bitterfox-MacBookPro% ~/bin/jdk9/bin/jshell -J-Duser.language=en
| Welcome to JShell -- Version 9
| For an introduction type: /help intro
jshell> void m(Object o) {}
| created method m(Object)
jshell> <T> void m(T o) {}
| replaced method m(T)
jshell> /l
2 : <T> void m(T o) {}
jshell> m("")
jshell>
Wrong behavior:
bitter_fox@bitterfox-MacBookPro% ~/bin/jdk9/bin/jshell -J-Duser.language=en
| Welcome to JShell -- Version 9
| For an introduction type: /help intro
jshell> void m(Object o) {}
| created method m(Object)
jshell> void m(Object o1) {}
| modified method m(Object)
jshell> <T> void m(T o1) {}
| created method m(T)
jshell> /l
2 : void m(Object o1) {}
3 : <T> void m(T o1) {}
jshell> m("")
| Error:
| reference to m is ambiguous
| both method <T>m(T) in and method m(java.lang.Object) in match
| m("")
| ^
jshell>
bitter_fox@bitterfox-MacBookPro% ~/bin/jdk9/bin/jshell -J-Duser.language=en
| Welcome to JShell -- Version 9
| For an introduction type: /help intro
jshell> void m(Object o) {}
| created method m(Object)
jshell> <T> void m(T o) {}
| replaced method m(T)
jshell> /l
2 : <T> void m(T o) {}
jshell> m("")
jshell>
Wrong behavior:
bitter_fox@bitterfox-MacBookPro% ~/bin/jdk9/bin/jshell -J-Duser.language=en
| Welcome to JShell -- Version 9
| For an introduction type: /help intro
jshell> void m(Object o) {}
| created method m(Object)
jshell> void m(Object o1) {}
| modified method m(Object)
jshell> <T> void m(T o1) {}
| created method m(T)
jshell> /l
2 : void m(Object o1) {}
3 : <T> void m(T o1) {}
jshell> m("")
| Error:
| reference to m is ambiguous
| both method <T>m(T) in and method m(java.lang.Object) in match
| m("")
| ^
jshell>