Java: `Array.getPackage()` (and `Array.getQualifiedName()`) cannot be used
Open
question
- Dominant language
- CodeQL
- Stars
- 10.1k
- Forks
- 2.1k
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 141
Description
Trying to use `Array.getPackage()` or any predicate depending on it, such as `Array.getQualifiedName()`, causes a compilation error:
```
Expr::ExprParent incompatible with Type::Array in context
```
The underlying problem seems to be that `RefType.getPackage()` only considers classes and interfaces, but not arrays. Maybe for arrays it should be compilable but simply have no result (should be documented in `getPackage()` and `getQualifiedName()` for `RefType` and `Array` then; maybe for other predicates as well)?
Relates to #5320
Contributor guide
Assessment
This issue has not been assessed yet.