RFR: 8305582: Compiler crash when compiling record patterns with var [v2]

Vicente Romero vromero at openjdk.org
Fri May 19 20:34:55 UTC 2023


On Fri, 19 May 2023 09:16:17 GMT, Aggelos Biboudis <abimpoudis at openjdk.org> wrote:

>> src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java line 4199:
>> 
>>> 4197:         Type site;
>>> 4198: 
>>> 4199:         if (tree.deconstructor == null) {
>> 
>> my question here would be, this situation can only happen if there are `var`(s) in the record pattern?
>
> I think so, yes:
> 
> https://github.com/openjdk/jdk/blob/master/src/jdk.compiler/share/classes/com/sun/tools/javac/parser/JavacParser.java#L846-L869
> 
> Initially I thought I could capture this situation before line 816, but then I wouldn't be able to flow an erroneous type from parsing (`types.createErrorType(tree.record.type);`).

ok sounds good

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/13331#discussion_r1199346549


More information about the compiler-dev mailing list