Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.0-beta-2
-
None
Description
The current implementation of the type checker allows to use methods of an object without the need of an explicit cast if it is wrapped in a proper instanceof check:
class A { void foo() {} } def o ... if (o instanceof A) { o.foo() }
But it doesn't work if the object is used as an argument:
class A {} void m(A a) { ... } def o ... if (o instanceof A) { m(o) // requires m((A) o) which should not be necessary }
Attachments
Issue Links
- relates to
-
GROOVY-11290 STC: multiple instanceof checks produce different results
- Closed