Skip to content

Instantly share code, notes, and snippets.

@hishidama
Created April 5, 2018 03:02
Show Gist options
  • Save hishidama/cb79457fc4e5c65a57992d3dc9e6be52 to your computer and use it in GitHub Desktop.
Save hishidama/cb79457fc4e5c65a57992d3dc9e6be52 to your computer and use it in GitHub Desktop.
JShellで以下のコードを打ち込むと固まる(Java10, CentOS7.3)
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も効かない)
@hishidama
Copy link
Author

Java9のJShellでは発生しない模様(正常に実行される)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment