Skip to content

Possible regression in compilation for generic records for Java from 3.3.1 #19578

Closed
@yilinwei

Description

Compiler version

Tested on:

  • branch main: fails
  • Released 3.3.1 succeeds

Minimized code

record R4<T>(t: T)

Output

[E161] Naming Error: tests/pos-java16+/java-records/R4.java:1:10 ----------------------------------------------------
1 |record R4<T>(T t) {}
  |          ^
  |          T is already defined as type T
  |
  |          Note that overloaded methods must all be defined in the same group of toplevel definitions

Expectation

Compiles

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions