Skip to content

Invalid generic signature for type params bounded by primitive #15385

Closed
@scf37

Description

@scf37

Compiler version

3.1.6

Minimized code

def foo[A <: Int]: A = ???

Output

public <A> A foo() {
    throw Predef$.MODULE$.$qmark$qmark$qmark();
}

Expectation

public int foo() {
    throw Predef$.MODULE$.$qmark$qmark$qmark();
}

It is important for performance of code dealing with types carrying meta-information like

type Validated[A] = A
opaque type Max[A, max] <: A with Validated[A] = A

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions