Index

Examples: A B C D E F G H I J K L M N O P Q R S T U V W X Y Z

compiler.err.cant.infer.local.var.type LocalArrayMissingTarget.java, LocalCantInferNull.java, LocalLambdaMissingTarget.java, LocalMissingInit.java, LocalMrefMissingTarget.java, LocalSelfRef.java
compiler.err.illegal.ref.to.var.type IllegalRefToVarType.java
compiler.err.var.not.allowed VarNotAllowed.java
compiler.err.var.not.allowed.array VarNotAllowedArray.java
compiler.err.var.not.allowed.compound VarNotAllowedCompound.java
compiler.err.var.not.allowed.here VarNotAllowedHere.java
compiler.misc.local.array.missing.target LocalArrayMissingTarget.java
compiler.misc.local.cant.infer.null LocalCantInferNull.java
compiler.misc.local.lambda.missing.target LocalLambdaMissingTarget.java
compiler.misc.local.missing.init LocalMissingInit.java
compiler.misc.local.mref.missing.target LocalMrefMissingTarget.java
compiler.misc.local.self.ref LocalSelfRef.java
compiler.warn.local.redundant.type LocalRedundantType.java

IllegalRefToVarType.java

examples/IllegalRefToVarType.java:31: error: illegal reference to restricted type 'var' var<String> list() { return null; } ^ 1 error

LocalArrayMissingTarget.java

examples/LocalArrayMissingTarget.java:29: error: cannot infer type for local variable x var x = { 1, 2, 3 }; ^ (array initializer needs an explicit target-type) 1 error

LocalCantInferNull.java

examples/LocalCantInferNull.java:31: error: cannot infer type for local variable s var s = null; ^ (variable initializer is 'null') 1 error

LocalLambdaMissingTarget.java

examples/LocalLambdaMissingTarget.java:31: error: cannot infer type for local variable x var x = () -> { }; ^ (lambda expression needs an explicit target-type) 1 error

LocalMissingInit.java

examples/LocalMissingInit.java:31: error: cannot infer type for local variable s var s; ^ (cannot use 'var' on variable without initializer) 1 error

LocalMrefMissingTarget.java

examples/LocalMrefMissingTarget.java:31: error: cannot infer type for local variable x var x = this::test; ^ (method reference needs an explicit target-type) 1 error

LocalRedundantType.java

examples/LocalRedundantType.java:31: warning: Redundant type for local variable (replace explicit type with 'var'). String s = ""; ^ 1 warning

LocalSelfRef.java

examples/LocalSelfRef.java:31: error: cannot infer type for local variable x var x = m(x); ^ (cannot use 'var' on self-referencing variable) 1 error

VarNotAllowed.java

examples/VarNotAllowed.java:28: error: 'var' not allowed here class var { } ^ as of release 9, 'var' is a restricted local variable type and cannot be used for type declarations 1 error

VarNotAllowedArray.java

examples/VarNotAllowedArray.java:30: error: 'var' is not allowed as an element type of an array var[] x = s; ^ 1 error

VarNotAllowedCompound.java

examples/VarNotAllowedCompound.java:30: error: 'var' is not allowed in a compound declaration var x = 1, y = 2; ^ 1 error

VarNotAllowedHere.java

examples/VarNotAllowedHere.java:29: error: 'var' is not allowed here var s = ""; ^ 1 error