Skip to content

Invalid generic signature when using singleton types #3553

Closed
@smarter

Description

@smarter
class Test {
  def foo: List[1] = List(1)
}

When compiling with -Xverify-signatures:

2 |  def foo: List[1] = List(1)
  |      ^
  |compiler bug: created invalid generic signature for method foo in Test
  |signature: ()Lscala/collection/immutable/List<I>;
  |if this is reproducible, please report bug at https://github.com/lampepfl/dotty/issues

List<I> is incorrect since Java generics can only range over reference types, it should be List<Object>, just like if the signature of foo was List[Int].

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions