github / github/codeql

Java: `Array.getPackage()` (and `Array.getQualifiedName()`) cannot be used

Aberta
#7,067 0 comentários 0 reações 0 responsáveis Ver no GitHub
question
Linguagem predominante
CodeQL
Estrelas
10.1k
Forks
2.1k
Merge médio
2d 15h
PRs com merge (30d)
141

Descrição

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

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.