github / github/codeql

Java: `RefType.inherits(Member)` does not work for member types

Aperta
#5,596 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Java question
Lingua principale
CodeQL
Stelle
10.1k
Fork
2.1k
Merge medio
2g 15h
PR unite (30g)
141

Descrizione

The predicate [`RefType.inherits(Member)`](https://codeql.github.com/codeql-standard-libraries/java/semmle/code/java/Type.qll/predicate.Type$RefType$inherits.1.html) does not work for member types (member classes or member interfaces), see also #5591.
If this is the intended behavior, it should at least be documented.

Currently the compiler does not even permit using a `NestedType` as argument for `inherits`.

Edit: However, based on [JLS 16 §8.2](https://docs.oracle.com/javase/specs/jls/se16/html/jls-8.html#jls-8.2) member types are "inherited", so it might be good if CodeQL reflected this.

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.