-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Closed
Labels
Description
scala> class C { def f: Int = 0 }
// defined class C
scala> class D { def f(): Int = 0 }
// defined class D
scala> def foo(x: C & D) = x.f
assertion failure for (C & D)(x) <:< ?{ f: ? }, frozen = false
Exception in thread "main" java.lang.AssertionError: assertion failed: Int & (): Int / TypeRef(TermRef(ThisType(TypeRef(NoPrefix,module class <root>)),module scala),class Int) & MethodType(List(), List(), TypeRef(TermRef(ThisType(TypeRef(NoPrefix,module class <root>)),module scala),class Int))
at dotty.DottyPredef$.assertFail(DottyPredef.scala:17)
at dotty.tools.dotc.core.Types$AndType$.apply(Types.scala:2777)
at dotty.tools.dotc.core.TypeComparer.andType$$anonfun$1(TypeComparer.scala:1924)
at dotty.tools.dotc.core.TypeComparer.liftIfHK(TypeComparer.scala:1963)
at dotty.tools.dotc.core.TypeComparer.andTypeGen(TypeComparer.scala:1901)
at dotty.tools.dotc.core.TypeComparer.andType(TypeComparer.scala:1924)
at dotty.tools.dotc.core.TypeComparer.glb(TypeComparer.scala:1723)
at dotty.tools.dotc.core.Types$Type.$amp(Types.scala:950)
at dotty.tools.dotc.core.Denotations$.infoMeet(Denotations.scala:656)
at dotty.tools.dotc.core.Denotations$Denotation.mergeSingleDenot$1(Denotations.scala:481)
at dotty.tools.dotc.core.Denotations$Denotation.mergeDenot$1(Denotations.scala:401)
at dotty.tools.dotc.core.Denotations$Denotation.$amp(Denotations.scala:504)