Skip to content

Dotty does not recognize polymorphic constructor in Java #8042

Closed
@liufengyun

Description

@liufengyun

minimized code

public class Exception {
    public <T> Exception(T actual, T matcher) { }

    public <T> Object foo(T actual, T matcher) { return null; }
}
-- [E006] Unbound Identifier Error: tests/pos/Exception.java:2:25 ------------------------------------------------------
2 |    public <T> Exception(T actual, T matcher) { }
  |                         ^
  |                         Not found: type T
-- [E006] Unbound Identifier Error: tests/pos/Exception.java:2:35 ------------------------------------------------------
2 |    public <T> Exception(T actual, T matcher) { }
  |                                   ^
  |                                   Not found: type T

expectation

The code should type check.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions