< prev index next >

test/langtools/tools/javac/diags/examples/PreviewFeatureUse.java

Print this page
*** 19,16 ***
   * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   * or visit www.oracle.com if you need additional information or have any
   * questions.
   */
  
! //key: compiler.warn.preview.feature.use.plural
! //key: compiler.misc.feature.var.syntax.in.implicit.lambda
  //options: -Xlint:preview -XDforcePreview -source ${jdk.version} --enable-preview
  
  import java.util.function.Function;
  
  class PreviewFeatureUse {
!     void test() {
!         Function<String, String> f = (var s) -> s;
      }
  }
--- 19,17 ---
   * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
   * or visit www.oracle.com if you need additional information or have any
   * questions.
   */
  
! //key: compiler.warn.preview.feature.use
! //key: compiler.misc.feature.flexible.constructors
  //options: -Xlint:preview -XDforcePreview -source ${jdk.version} --enable-preview
  
  import java.util.function.Function;
  
  class PreviewFeatureUse {
!     PreviewFeatureUse() {
!         System.out.println("early init!");
+         super();
      }
  }
< prev index next >