Skip to content

Compiler crash when doing structural typing with missing parameter lists #8098

Open
@scabug

Description

@scabug

The following snippet slays the compiler:

class Foo {
  def duck()(times: Int) = this
}

object Bar {  
  def duckDuckGo[T](t: T { 
    def duck() /* (times: Int) */ : T 
  }) = {}

  duckDuckGo(new Foo())
}
uncaught exception during compilation: scala.reflect.internal.Types$NoCommonType
error: scala.reflect.internal.Types$NoCommonType: lub/glb of incompatible types: (implicit times: Int)Foo and Foo

There were a couple of related errors I came upon whilst trimming down the reproducible, but for now, this seems to be the core issue.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions