Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should create warning or error for inherited unusable predicates #93

Open
Marcono1234 opened this issue Nov 6, 2021 · 0 comments
Open
Labels

Comments

@Marcono1234
Copy link
Contributor

Marcono1234 commented Nov 6, 2021

Currently CodeQL permits writing classes with predicates using database queries, and then subclasses which do not fulfill the requirements for these database types. This renders these inherited predicates unusable and creates pretty cryptic compilation errors when trying to use them. Examples:

It would be good if:

  1. The CodeQL compiler would detect such unusuable inherited predicates and cause a compilation error (or at least a warning) for the subclass. This would avoid exposing such subclasses to the user, causing the cryptic compilation errors when they try to use predicates of the subclass.
  2. The error message would be clearer, ideally pointing to where the requirement for the database types come from, with predicate call hierarchy if possible. For example for CodeQL Java's Array.getQualifiedName() (see Java: Array.getPackage() (and Array.getQualifiedName()) cannot be used codeql#7067) it should indicate that RefType.getPackage() only supports @class and @interface.
@github-actions github-actions bot added the CLI label Nov 6, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant