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 Symbol sym,
|
||||
final DiagnosticPosition deferPos) {
|
||||
|
||||
Assert.checkNonNull(sym);
|
||||
normal(new Annotate.Worker() {
|
||||
@Override
|
||||
public String toString() {
|
||||
|
@ -769,13 +769,6 @@ public class Attr extends JCTree.Visitor {
|
||||
= deferredLintHandler.setPos(variable.pos());
|
||||
|
||||
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);
|
||||
if (itype.constValue() != null) {
|
||||
return coerce(itype, type).constValue();
|
||||
|
Loading…
Reference in New Issue
Block a user