In jshell-11, why does a redeclared reference variable that resets to null still have a type?

巧了我就是萌 提交于 2019-12-04 01:11:24

The problem is that, though it says it is set to null, it actually isn't. See added comments in bug for more detail.

I've changed the bug title to: JShell: Redeclared variable should be reset

I'll attempt to fix in JDK 12.

The second issue is not a bug, Java does not allow instanceof operators that cannot be true -- behavior matches javac exactly.

I've raised it as a bug and it's been accepted.

https://bugs.openjdk.java.net/browse/JDK-8211694

Good spot.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!