Created
April 5, 2018 03:02
-
-
Save hishidama/cb79457fc4e5c65a57992d3dc9e6be52 to your computer and use it in GitHub Desktop.
JShellで以下のコードを打ち込むと固まる(Java10, CentOS7.3)
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
class Foo { | |
public String getValue() { return "foo" ; } | |
} | |
interface Bar { | |
Integer getId(); | |
} | |
class Baz extends Foo implements Bar { | |
public Integer getId() { return 123; } | |
} | |
<T extends Foo & Bar> Stream<Integer> to1(Stream<T> s) { | |
return s.map(t->t.getId()); | |
} | |
to1(Stream.of(new Baz())); | |
interface Foo { | |
public String getValue(); | |
} | |
// 本来ならばFooが置換されるはずだが、コンソールに戻ってこなくなる(Ctrl+Cも効かない) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Java9のJShellでは発生しない模様(正常に実行される)