--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TypeEnter.java Mon Jan 14 17:20:20 2019 +0100
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/TypeEnter.java Mon Jan 14 12:24:25 2019 -0500
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
@@ -831,8 +831,8 @@
annotate.annotateLater(tree.mods.annotations, baseEnv,
sym, tree.pos());
+ attr.attribTypeVariables(tree.typarams, baseEnv, false);
- attr.attribTypeVariables(tree.typarams, baseEnv);
for (JCTypeParameter tp : tree.typarams)
annotate.queueScanTreeAndTypeAnnotate(tp, baseEnv, sym, tree.pos());
@@ -939,6 +939,12 @@
env.info.scope.enter(superSym);
}
+ if (!tree.typarams.isEmpty()) {
+ for (JCTypeParameter tvar : tree.typarams) {
+ chk.checkNonCyclic(tvar, (TypeVar)tvar.type);
+ }
+ }
+
finishClass(tree, env);
if (allowTypeAnnos) {