You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by "Eric Milles (Jira)" <ji...@apache.org> on 2025/03/23 20:43:00 UTC
[jira] [Created] (GROOVY-11585) instanceof with parameterized type
Eric Milles created GROOVY-11585:
------------------------------------
Summary: instanceof with parameterized type
Key: GROOVY-11585
URL: https://issues.apache.org/jira/browse/GROOVY-11585
Project: Groovy
Issue Type: Bug
Reporter: Eric Milles
Assignee: Eric Milles
The {{instanceof}} operator supports parameterized types. However, the types are erased at runtime, so the check can be improper. For example:
{code:groovy}
def list = [1,2,3]
if (list instanceof List<String>) {
// yes List but not of String
}
{code}
--
This message was sent by Atlassian Jira
(v8.20.10#820010)