Aligning compiler messages for using preview API with preview language features?

Joe Darcy joe.darcy at
Wed Jul 3 00:33:35 UTC 2019


As a follow-up to some recent work ("Improving compiler messages for 
preview API " [1]), I wanted to get some feedback on a possible 
variation of the work to align the messages for using preview API 
elements and using preview language features.

Assuming some mechanism to implement a predicate identifying a preview 
API (presence of an annotation, side table in the compiler, etc.), the 
messages for preview APIs could be routed through the same 
previewHandler used to process preview language features.

The summary message

     Note: uses preview language features.
     Note: Recompile with -Xlint:preview for details.

could then be replaced with something like

     Note: uses preview language features and/or preview API 
     Note: Recompile with -Xlint:preview for details.

or more specialize variants for the particular combinations of a least 
one flavor of preview functionality being used.





More information about the compiler-dev mailing list