github / github/codeql

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

オープン
#7,067 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
question
主要言語
CodeQL
スター
10.1k
フォーク
2.1k
平均マージ
2日 15時間
マージ済み PR(30日)
141

説明

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

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。