Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
2.3.10, 2.4.1
-
None
Description
The following code fails with a weird type checking error:
import groovy.transform.TypeChecked int len(byte[] arr) { arr.length } @TypeChecked def foo(arg) { if (arg instanceof byte[]) { len(arg) } } foo(new byte[3])
Error:
[Static type checking] - Cannot call ConsoleScript0#len(byte[]) with arguments [<UnionTypejava.lang.Object+[B>]
at line: 7, column: 7
Attachments
Issue Links
- relates to
-
GROOVY-11290 STC: multiple instanceof checks produce different results
- Closed
-
GROOVY-11137 Improve support for union and intersection types
- Open