Details
-
Bug
-
Status: Closed
-
Blocker
-
Resolution: Fixed
-
1.6
-
None
-
None
-
Discovered running on Windows XP, JDK 1.6.0_07
Description
Member hiding behavior has changed between 1.5.7 and 1.6 . Previous code which caused member hiding now does not.
class Foo { String bar void doIt() { def bar = new File('.') println bar instanceof File // prints false (1.6), true (1.5.7) println bar instanceof String // prints true (1.6), false (1.5.7) } } def foo = new Foo() foo.doIt()
Roshan:
"""
Looks like a bug to me because
class Foo { String bar void doIt(File bar) { println bar instanceof File // returns true } } def foo = new Foo() foo.doIt(new File('.'))
And it should be consistent in hiding behavior whethere it is a method parameter that is doing the hiding or a local, method-level variable.
"""
Jochen:
"""
that is clearly a bug that crept in unnoticed. Please fill an issue for it, this absolutely needs to be fixed for the next release
"""