RFR(12): JDK-8207229: Trees.getScope crashes for broken lambda; JDK-8207230: Trees.getScope runs Analyzers
jan.lahoda at oracle.com
Fri Jul 13 16:43:50 UTC 2018
The proposed patch attempts to fix two problems with Trees.getScope:
-a NPE when a lambda is categorized as an implicit lambda, but has a
parameter with type (in erroneous source); when
Attr.fallbackDescriptorType constructs the fallback descriptor, it uses
the (unattributed) type of the parameter, which then leads to the NPE.
The proposal is to check if the type of the parameter is present, and
use syms.errType if not present.
-Analyzers appear to run while the Scope is being computed by
Trees.getScope. This does not seem necessary (as the attribution
typically runs on a copy of the AST, not on the real AST).
Does this look reasonable?
More information about the compiler-dev