mirror of
https://github.com/openjdk/jdk.git
synced 2025-09-17 01:24:33 +02:00
8006566: Remove transient lambda-related guards from JavacParser
Remove transitional internal flag for allowing intersection types in cast Reviewed-by: jjg
This commit is contained in:
parent
442154dcf9
commit
422c8bd914
7 changed files with 6 additions and 10 deletions
|
@ -124,9 +124,7 @@ public class JavacParser implements Parser {
|
|||
this.allowLambda = source.allowLambda();
|
||||
this.allowMethodReferences = source.allowMethodReferences();
|
||||
this.allowDefaultMethods = source.allowDefaultMethods();
|
||||
this.allowIntersectionTypesInCast =
|
||||
source.allowIntersectionTypesInCast() &&
|
||||
fac.options.isSet("allowIntersectionTypes");
|
||||
this.allowIntersectionTypesInCast = source.allowIntersectionTypesInCast();
|
||||
this.keepDocComments = keepDocComments;
|
||||
docComments = newDocCommentTable(keepDocComments, fac);
|
||||
this.keepLineMap = keepLineMap;
|
||||
|
|
|
@ -287,8 +287,7 @@ public class IntersectionTypeCastTest
|
|||
final JavaCompiler tool = ToolProvider.getSystemJavaCompiler();
|
||||
|
||||
JavacTask ct = (JavacTask)tool.getTask(null, fm.get(), diagChecker,
|
||||
Arrays.asList("-XDallowIntersectionTypes"),
|
||||
null, Arrays.asList(source));
|
||||
null, null, Arrays.asList(source));
|
||||
try {
|
||||
ct.analyze();
|
||||
} catch (Throwable ex) {
|
||||
|
|
|
@ -170,7 +170,7 @@ public class IntersectionTypeParserTest {
|
|||
void run(JavaCompiler tool, StandardJavaFileManager fm) throws Exception {
|
||||
checkCount++;
|
||||
JavacTask ct = (JavacTask)tool.getTask(null, fm, diagChecker,
|
||||
Arrays.asList("-XDallowIntersectionTypes"), null, Arrays.asList(source));
|
||||
null, null, Arrays.asList(source));
|
||||
ct.parse();
|
||||
if (diagChecker.errorFound) {
|
||||
throw new Error("Unexpected parser error for source:\n" +
|
||||
|
|
|
@ -27,7 +27,7 @@
|
|||
* @summary Add support for intersection types in cast expression
|
||||
* @library /tools/javac/lib
|
||||
* @build JavacTestingAbstractProcessor ModelChecker
|
||||
* @compile -XDallowIntersectionTypes -processor ModelChecker Model01.java
|
||||
* @compile -processor ModelChecker Model01.java
|
||||
*/
|
||||
|
||||
import javax.lang.model.element.ElementKind;
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
|
||||
// key: compiler.err.prob.found.req
|
||||
// key: compiler.misc.secondary.bound.must.be.marker.intf
|
||||
// options: -XDallowIntersectionTypes
|
||||
|
||||
class SecondaryBoundMustBeMarkerInterface {
|
||||
Runnable r = (Runnable & Comparable<?>)()->{};
|
||||
|
|
|
@ -25,7 +25,7 @@
|
|||
* @test
|
||||
* @bug 8002099
|
||||
* @summary Add support for intersection types in cast expression
|
||||
* @compile/fail/ref=Intersection01.out -XDallowIntersectionTypes -XDrawDiagnostics Intersection01.java
|
||||
* @compile/fail/ref=Intersection01.out -XDrawDiagnostics Intersection01.java
|
||||
*/
|
||||
class Intersection01 {
|
||||
|
||||
|
|
|
@ -248,7 +248,7 @@ public class IntersectionTargetTypeTest {
|
|||
|
||||
void run(JavaCompiler tool, StandardJavaFileManager fm) throws Exception {
|
||||
JavacTask ct = (JavacTask)tool.getTask(null, fm, diagChecker,
|
||||
Arrays.asList("-XDallowIntersectionTypes"), null, Arrays.asList(source));
|
||||
null, null, Arrays.asList(source));
|
||||
try {
|
||||
ct.analyze();
|
||||
} catch (Throwable ex) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue