Georgi Krastev

Results 411 comments of Georgi Krastev

The error comes from: https://github.com/scala/scala/blob/2.13.x/src/compiler/scala/tools/nsc/transform/ExplicitOuter.scala#L422 Looks like Scala 3 has a `HoistSuperArgs` which makes code like this simpler: https://github.com/lampepfl/dotty/blob/main/compiler/src/dotty/tools/dotc/transform/HoistSuperArgs.scala Another issue is that the synthetic `LazyDefns$1` tree has no position....

Ugh, just this line kills the REPL: ```scala class CrashIt[A[_]] if (true) new CrashIt[Option] else new CrashIt[List] ```

Uh-oh, note the ill-kinded type inference: ```scala scala> List(new CrashIt[Option], new CrashIt[List]) :39: error: type mismatch; found : CrashIt[Option] required: CrashIt[_ >: List with Option : List with Option

I guess by calling `info` you mean: ```scala def baseTypeSeqLength(sym: Symbol) = if (sym.isAbstractType) 1 + sym.info.upperBound.baseTypeSeq.length else sym.info.baseTypeSeq.length ```

I think the comment explains it: > A total ordering between symbols that refines the class inheritance graph (i.e. subclass.isLess(superclass) always holds). the ordering is given by: (_.isType, -_.baseTypeSeq.length) for...

So the solution in theory is simple enough - switch to comparing types instead of comparing symbols

Something like this: ```scala /** A total ordering between symbols that refines the class * inheritance graph (i.e. subclass.isLess(superclass) always holds). * the ordering is given by: (_.isType, -_.baseTypeSeq.length) for...

Scala 3 has union types so I don't think the LUB can be simply backported

@adriaanm-da I tried but a test fails and I don't understand why: scala/scala#9937