Truffle DSL Warnings

Since version 23.0, Truffle DSL now produces significantly more warnings. These warnings are intended to guide the user to better DSL usage. The following sections describe how to handle and eventually suppress warnings.

All warnings of Truffle DSL can be suppressed using the -Atruffle.dsl.SuppressAllWarnings=true option. If a language uses strict checks where warnings are treated as errors in their CI, it is recommended to add this option to the Java compilation command line. This can be useful to avoid CI failures when Truffle DSL adds new warning messages. Adding new warning messages in Truffle DSL is considered a compatible change.

Truffle DSL warnings can be suppressed just like Java warnings using the @SuppressWarnings annotation or with@SuppressPackageWarnings for entire packages. The following warning keys are supported:

Specific warnings can also be suppressed globally using the -Atruffle.dsl.SuppressWarnings=truffle-inlining,truffle-neverdefault Java compiler processor option. Note that also Java system properties can be used to configure the annotation processor. (e.g. by passing -J-Dtruffle.dsl.SuppressWarnings=truffle-inlining,truffle-neverdefault to javac)

Suppressing a specific warning should be preferred over suppressing all warnings. Find the latest list of warnings in the source code