Skip to content

Compiler crash while compiling structural types with type member #1897

@liufengyun

Description

@liufengyun

Following two examples crashes the compiler with the implementation of structural types in #1881

Test 1

import scala.reflect.Selectable.reflectiveSelectable

object Test {
  def g(x: { type T ; def t: T ; def f(a: T): Boolean }) = x.f(x.t)
  g(new { type T = Int; def t = 4; def f(a:T) = true })
  g(new { type T = Any; def t = 4; def f(a:T) = true })
}

Test 2

import scala.reflect.Selectable.reflectiveSelectable

object Test {
  def g(x: { def f[T](a: T): Int }) = x.f[Int](4)
}

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions