8036142: Remove redundant call to annotateTypeLater with null Symbol
AnnotateTypeLater (formerly typeAnnotate) with null as the symbol was a way to force attribution of type annotations, but this is now obsolete and problematic, and a silent noop condition Reviewed-by: jjg
This commit is contained in:
parent
74250736aa
commit
6b9060ac8f
@ -842,7 +842,7 @@ public class Annotate {
|
|||||||
final Env<AttrContext> env,
|
final Env<AttrContext> env,
|
||||||
final Symbol sym,
|
final Symbol sym,
|
||||||
final DiagnosticPosition deferPos) {
|
final DiagnosticPosition deferPos) {
|
||||||
|
Assert.checkNonNull(sym);
|
||||||
normal(new Annotate.Worker() {
|
normal(new Annotate.Worker() {
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
|
@ -769,13 +769,6 @@ public class Attr extends JCTree.Visitor {
|
|||||||
= deferredLintHandler.setPos(variable.pos());
|
= deferredLintHandler.setPos(variable.pos());
|
||||||
|
|
||||||
try {
|
try {
|
||||||
// Use null as symbol to not attach the type annotation to any symbol.
|
|
||||||
// The initializer will later also be visited and then we'll attach
|
|
||||||
// to the symbol.
|
|
||||||
// This prevents having multiple type annotations, just because of
|
|
||||||
// lazy constant value evaluation.
|
|
||||||
annotate.annotateTypeLater(variable.init, env, null, variable.pos());
|
|
||||||
annotate.flush();
|
|
||||||
Type itype = attribExpr(variable.init, env, type);
|
Type itype = attribExpr(variable.init, env, type);
|
||||||
if (itype.constValue() != null) {
|
if (itype.constValue() != null) {
|
||||||
return coerce(itype, type).constValue();
|
return coerce(itype, type).constValue();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user