Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unexpected tree in genLoad: TypeTree[TypeRef(ThisType(TypeRef(NoPrefix,module class inspector)),trait Tasty)]/class dotty.tools.dotc.ast.Trees$TypeTree #14783

Closed
xuwei-k opened this issue Mar 26, 2022 · 4 comments · Fixed by #14816 or #16112
Assignees
Milestone

Comments

@xuwei-k
Copy link
Contributor

xuwei-k commented Mar 26, 2022

Compiler version

  • 3.1.1
  • 3.1.2-RC3
  • 3.1.3-RC1-bin-20220325-6f3fe05-NIGHTLY

Minimized code

scalaVersion := "3.1.3-RC1-bin-20220325-6f3fe05-NIGHTLY"

libraryDependencies += "org.scala-lang" %% "scala3-tasty-inspector" % scalaVersion.value
package example

import scala.quoted.Quotes
import scala.tasty.inspector.Inspector
import scala.tasty.inspector.Tasty

object WartInspector {
  def myWartTraverser: WartTraverser = ???
  def inspector = new Inspector {
    def inspect(using q: Quotes)(tastys: List[Tasty[q.type]]): Unit = {
      val universe: WartUniverse.Aux[q.type] = WartUniverse(q)
      val traverser = myWartTraverser.get(universe)
      tastys.zipWithIndex.foreach { (tasty, index) =>
        val tree = tasty.ast
        traverser.traverseTree(tree)(tree.symbol)
      }
    }
  }
}

object WartUniverse {
  type Aux[X <: Quotes] = WartUniverse { type Q = X }

  def apply[Q <: Quotes](quotes: Q): Aux[Q] = ???
}

abstract class WartUniverse { self =>
  type Q <: Quotes
  val quotes: Q

  abstract class Traverser extends quotes.reflect.TreeTraverser
}

abstract class WartTraverser { self =>
  def get(u: WartUniverse): u.Traverser
}

Output (click arrow to expand)

[error] java.lang.RuntimeException: Unexpected tree in genLoad: TypeTree[TypeRef(ThisType(TypeRef(NoPrefix,module class inspector)),trait Tasty)]/class dotty.tools.dotc.ast.Trees$TypeTree at: <570..570>
[error] dotty.tools.backend.jvm.BCodeHelpers.abort(BCodeHelpers.scala:951)
[error] dotty.tools.backend.jvm.BCodeHelpers.abort$(BCodeHelpers.scala:45)
[error] dotty.tools.backend.jvm.GenBCodePipeline.abort(GenBCode.scala:116)
[error] dotty.tools.backend.jvm.BCodeBodyBuilder$PlainBodyBuilder.genLoad(BCodeBodyBuilder.scala:455)
[error] dotty.tools.backend.jvm.BCodeBodyBuilder$PlainBodyBuilder.genLoad(BCodeBodyBuilder.scala:286)
[error] dotty.tools.backend.jvm.BCodeBodyBuilder$PlainBodyBuilder.genLoadQualifier(BCodeBodyBuilder.scala:1111)
[error] dotty.tools.backend.jvm.BCodeBodyBuilder$PlainBodyBuilder.genApply(BCodeBodyBuilder.scala:772)
[error] dotty.tools.backend.jvm.BCodeBodyBuilder$PlainBodyBuilder.genLoad(BCodeBodyBuilder.scala:362)
[error] dotty.tools.backend.jvm.BCodeBodyBuilder$PlainBodyBuilder.genLoad(BCodeBodyBuilder.scala:286)
[error] dotty.tools.backend.jvm.BCodeBodyBuilder$PlainBodyBuilder.genLoadQualifier(BCodeBodyBuilder.scala:1111)
[error] dotty.tools.backend.jvm.BCodeBodyBuilder$PlainBodyBuilder.genTypeApply(BCodeBodyBuilder.scala:639)
[error] dotty.tools.backend.jvm.BCodeBodyBuilder$PlainBodyBuilder.genLoad(BCodeBodyBuilder.scala:453)
[error] dotty.tools.backend.jvm.BCodeBodyBuilder$PlainBodyBuilder.genLoad(BCodeBodyBuilder.scala:286)
[error] dotty.tools.backend.jvm.BCodeBodyBuilder$PlainBodyBuilder.genLoadQualifier(BCodeBodyBuilder.scala:1111)
[error] dotty.tools.backend.jvm.BCodeBodyBuilder$PlainBodyBuilder.genApply(BCodeBodyBuilder.scala:772)
[error] dotty.tools.backend.jvm.BCodeBodyBuilder$PlainBodyBuilder.genLoad(BCodeBodyBuilder.scala:362)
[error] dotty.tools.backend.jvm.BCodeBodyBuilder$PlainBodyBuilder.genLoad(BCodeBodyBuilder.scala:286)
[error] dotty.tools.backend.jvm.BCodeBodyBuilder$PlainBodyBuilder.genLoadQualifier(BCodeBodyBuilder.scala:1111)
[error] dotty.tools.backend.jvm.BCodeBodyBuilder$PlainBodyBuilder.genApply(BCodeBodyBuilder.scala:772)
[error] dotty.tools.backend.jvm.BCodeBodyBuilder$PlainBodyBuilder.genLoad(BCodeBodyBuilder.scala:362)
[error] dotty.tools.backend.jvm.BCodeBodyBuilder$PlainBodyBuilder.genLoad(BCodeBodyBuilder.scala:286)
[error] dotty.tools.backend.jvm.BCodeBodyBuilder$PlainBodyBuilder.genLoadQualifier(BCodeBodyBuilder.scala:1111)
[error] dotty.tools.backend.jvm.BCodeBodyBuilder$PlainBodyBuilder.genApply(BCodeBodyBuilder.scala:772)
[error] dotty.tools.backend.jvm.BCodeBodyBuilder$PlainBodyBuilder.genLoad(BCodeBodyBuilder.scala:362)
[error] dotty.tools.backend.jvm.BCodeBodyBuilder$PlainBodyBuilder.genLoadArguments(BCodeBodyBuilder.scala:1127)
[error] dotty.tools.backend.jvm.BCodeBodyBuilder$PlainBodyBuilder.genLoadArguments(BCodeBodyBuilder.scala:1128)
[error] dotty.tools.backend.jvm.BCodeBodyBuilder$PlainBodyBuilder.genApply(BCodeBodyBuilder.scala:773)
[error] dotty.tools.backend.jvm.BCodeBodyBuilder$PlainBodyBuilder.genLoad(BCodeBodyBuilder.scala:362)
[error] dotty.tools.backend.jvm.BCodeBodyBuilder$PlainBodyBuilder.genBlock(BCodeBodyBuilder.scala:1020)
[error] dotty.tools.backend.jvm.BCodeBodyBuilder$PlainBodyBuilder.genLoad(BCodeBodyBuilder.scala:433)
[error] dotty.tools.backend.jvm.BCodeBodyBuilder$PlainBodyBuilder.genLoad(BCodeBodyBuilder.scala:432)
[error] dotty.tools.backend.jvm.BCodeSkelBuilder$PlainSkelBuilder.emitNormalMethodBody$1(BCodeSkelBuilder.scala:763)
[error] dotty.tools.backend.jvm.BCodeSkelBuilder$PlainSkelBuilder.genDefDef(BCodeSkelBuilder.scala:798)
[error] dotty.tools.backend.jvm.BCodeSkelBuilder$PlainSkelBuilder.gen(BCodeSkelBuilder.scala:606)
[error] dotty.tools.backend.jvm.BCodeSkelBuilder$PlainSkelBuilder.gen$$anonfun$1(BCodeSkelBuilder.scala:612)
[error] scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
[error] scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
[error] scala.collection.immutable.List.foreach(List.scala:333)
[error] dotty.tools.backend.jvm.BCodeSkelBuilder$PlainSkelBuilder.gen(BCodeSkelBuilder.scala:612)
[error] dotty.tools.backend.jvm.BCodeSkelBuilder$PlainSkelBuilder.genPlainClass(BCodeSkelBuilder.scala:227)
[error] dotty.tools.backend.jvm.GenBCodePipeline$Worker1.visit(GenBCode.scala:264)
[error] dotty.tools.backend.jvm.GenBCodePipeline$Worker1.run(GenBCode.scala:229)
[error] dotty.tools.backend.jvm.GenBCodePipeline.buildAndSendToDisk(GenBCode.scala:565)
[error] dotty.tools.backend.jvm.GenBCodePipeline.run(GenBCode.scala:531)
[error] dotty.tools.backend.jvm.GenBCode.run(GenBCode.scala:67)
[error] dotty.tools.dotc.core.Phases$Phase.runOn$$anonfun$1(Phases.scala:311)
[error] scala.collection.immutable.List.map(List.scala:246)
[error] dotty.tools.dotc.core.Phases$Phase.runOn(Phases.scala:312)
[error] dotty.tools.backend.jvm.GenBCode.runOn(GenBCode.scala:75)
[error] dotty.tools.dotc.Run.runPhases$1$$anonfun$1(Run.scala:225)
[error] scala.runtime.function.JProcedure1.apply(JProcedure1.java:15)
[error] scala.runtime.function.JProcedure1.apply(JProcedure1.java:10)
[error] scala.collection.ArrayOps$.foreach$extension(ArrayOps.scala:1328)
[error] dotty.tools.dotc.Run.runPhases$1(Run.scala:236)
[error] dotty.tools.dotc.Run.compileUnits$$anonfun$1(Run.scala:244)
[error] dotty.tools.dotc.Run.compileUnits$$anonfun$adapted$1(Run.scala:253)
[error] dotty.tools.dotc.util.Stats$.maybeMonitored(Stats.scala:68)
[error] dotty.tools.dotc.Run.compileUnits(Run.scala:253)
[error] dotty.tools.dotc.Run.compileSources(Run.scala:186)
[error] dotty.tools.dotc.Run.compile(Run.scala:170)
[error] dotty.tools.dotc.Driver.doCompile(Driver.scala:35)
[error] dotty.tools.xsbt.CompilerBridgeDriver.run(CompilerBridgeDriver.java:88)
[error] dotty.tools.xsbt.CompilerBridge.run(CompilerBridge.java:22)
[error] sbt.internal.inc.AnalyzingCompiler.compile(AnalyzingCompiler.scala:91)
[error] sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$7(MixedAnalyzingCompiler.scala:192)
[error] scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23)
[error] sbt.internal.inc.MixedAnalyzingCompiler.timed(MixedAnalyzingCompiler.scala:247)
[error] sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$4(MixedAnalyzingCompiler.scala:182)
[error] sbt.internal.inc.MixedAnalyzingCompiler.$anonfun$compile$4$adapted(MixedAnalyzingCompiler.scala:163)
[error] sbt.internal.inc.JarUtils$.withPreviousJar(JarUtils.scala:239)
[error] sbt.internal.inc.MixedAnalyzingCompiler.compileScala$1(MixedAnalyzingCompiler.scala:163)
[error] sbt.internal.inc.MixedAnalyzingCompiler.compile(MixedAnalyzingCompiler.scala:210)
[error] sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1(IncrementalCompilerImpl.scala:528)
[error] sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileInternal$1$adapted(IncrementalCompilerImpl.scala:528)
[error] sbt.internal.inc.Incremental$.$anonfun$apply$5(Incremental.scala:177)
[error] sbt.internal.inc.Incremental$.$anonfun$apply$5$adapted(Incremental.scala:175)
[error] sbt.internal.inc.Incremental$$anon$2.run(Incremental.scala:461)
[error] sbt.internal.inc.IncrementalCommon$CycleState.next(IncrementalCommon.scala:116)
[error] sbt.internal.inc.IncrementalCommon$$anon$1.next(IncrementalCommon.scala:56)
[error] sbt.internal.inc.IncrementalCommon$$anon$1.next(IncrementalCommon.scala:52)
[error] sbt.internal.inc.IncrementalCommon.cycle(IncrementalCommon.scala:263)
[error] sbt.internal.inc.Incremental$.$anonfun$incrementalCompile$8(Incremental.scala:416)
[error] sbt.internal.inc.Incremental$.withClassfileManager(Incremental.scala:503)
[error] sbt.internal.inc.Incremental$.incrementalCompile(Incremental.scala:403)
[error] sbt.internal.inc.Incremental$.apply(Incremental.scala:169)
[error] sbt.internal.inc.IncrementalCompilerImpl.compileInternal(IncrementalCompilerImpl.scala:528)
[error] sbt.internal.inc.IncrementalCompilerImpl.$anonfun$compileIncrementally$1(IncrementalCompilerImpl.scala:482)
[error] sbt.internal.inc.IncrementalCompilerImpl.handleCompilationError(IncrementalCompilerImpl.scala:332)
[error] sbt.internal.inc.IncrementalCompilerImpl.compileIncrementally(IncrementalCompilerImpl.scala:420)
[error] sbt.internal.inc.IncrementalCompilerImpl.compile(IncrementalCompilerImpl.scala:137)
[error] sbt.Defaults$.compileIncrementalTaskImpl(Defaults.scala:2366)
[error] sbt.Defaults$.$anonfun$compileIncrementalTask$2(Defaults.scala:2316)
[error] sbt.internal.server.BspCompileTask$.$anonfun$compute$1(BspCompileTask.scala:30)
[error] sbt.internal.io.Retry$.apply(Retry.scala:46)
[error] sbt.internal.io.Retry$.apply(Retry.scala:28)
[error] sbt.internal.io.Retry$.apply(Retry.scala:23)
[error] sbt.internal.server.BspCompileTask$.compute(BspCompileTask.scala:30)
[error] sbt.Defaults$.$anonfun$compileIncrementalTask$1(Defaults.scala:2314)
[error] scala.Function1.$anonfun$compose$1(Function1.scala:49)
[error] sbt.internal.util.$tilde$greater.$anonfun$$u2219$1(TypeFunctions.scala:62)
[error] sbt.std.Transform$$anon$4.work(Transform.scala:68)
[error] sbt.Execute.$anonfun$submit$2(Execute.scala:282)
[error] sbt.internal.util.ErrorHandling$.wideConvert(ErrorHandling.scala:23)
[error] sbt.Execute.work(Execute.scala:291)
[error] sbt.Execute.$anonfun$submit$1(Execute.scala:282)
[error] sbt.ConcurrentRestrictions$$anon$4.$anonfun$submitValid$1(ConcurrentRestrictions.scala:265)
[error] sbt.CompletionService$$anon$2.call(CompletionService.scala:64)
[error] java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511)
[error] java.util.concurrent.FutureTask.run(FutureTask.java:266)
[error] java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1149)
[error] java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:624)
[error] java.lang.Thread.run(Thread.java:750)
@xuwei-k xuwei-k added itype:bug itype:crash stat:needs triage Every issue needs to have an "area" and "itype" label labels Mar 26, 2022
@xuwei-k
Copy link
Contributor Author

xuwei-k commented Mar 26, 2022

Note

compiler does not throw error if add explicit type here

       tastys.zipWithIndex.foreach { (tasty, index) =>
-        val tree = tasty.ast
+        val tree: q.reflect.Tree = tasty.ast
         traverser.traverseTree(tree)(tree.symbol)

@Kordyjan Kordyjan added area:tasty-inspector issues relating to the TASTy inspector and removed stat:needs triage Every issue needs to have an "area" and "itype" label labels Mar 28, 2022
@nicolasstucki
Copy link
Contributor

Self contained version

object WartInspector:
  def myWartTraverser: WartTraverser = ???
  def inspect(using q: Quotes)(tastys: List[Tasty[q.type]]): Unit = {
    val universe: WartUniverse.Aux[q.type] = WartUniverse(q)
    val traverser = myWartTraverser.get(universe)
    tastys.zipWithIndex.foreach { (tasty, index) =>
      val tree = tasty.ast
      traverser.traverseTree(tree)(tree.symbol)
    }
  }

object WartUniverse:
  type Aux[X <: Quotes] = WartUniverse { type Q = X }
  def apply[Q <: Quotes](quotes: Q): Aux[Q] = ???


abstract class WartUniverse:
  type Q <: Quotes
  val quotes: Q
  abstract class Traverser extends quotes.reflect.TreeTraverser


abstract class WartTraverser:
  def get(u: WartUniverse): u.Traverser

trait Tasty[Q <: Quotes & Singleton]:
  val quotes: Q
  def path: String
  def ast: quotes.reflect.Tree

trait Quotes:
  object reflect:
    type Tree
    extension (self: Tree) def symbol: Symbol = ???
    type Symbol
    trait TreeTraverser:
      def traverseTree(tree: Tree)(symbol: Symbol): Unit

@nicolasstucki
Copy link
Contributor

Minimized to

object Wart:
  def bar(using c: Ctx)(ws: List[Wrap[c.type]]): Unit =
    ws.zipWithIndex.foreach { (w, _) => w.x.foo }

trait Wrap[C <: Ctx & Singleton]:
  val ctx: C
  def x: ctx.inner.X

trait Ctx:
  object inner:
    type X
    extension (self: X) def foo: Int = ???

@nicolasstucki
Copy link
Contributor

nicolasstucki commented Mar 28, 2022

With -Xprint:typer we can see that the extension method is expanded as example.Wrap[(c : example.Ctx)]#ctx.inner.foo(w.x). We should have w.ctx.inner.foo(w.x) or c.inner.foo(w.x).

odersky added a commit to dotty-staging/dotty that referenced this issue Mar 31, 2022
scala#14783 shows an example where an implicit reference was generated that started in a type.
The backend then crashed since it could not emit instructions to load that reference. We
now detect such references when they are created and flag them as errors.

We need to separately fix the issue that created the bad reference in the first place.
odersky added a commit to dotty-staging/dotty that referenced this issue Mar 31, 2022
scala#14783 shows an example where an implicit reference was generated that started in a type.
The backend then crashed since it could not emit instructions to load that reference. We
now detect such references when they are created and flag them as errors.

We need to separately fix the issue that created the bad reference in the first place.
michelou pushed a commit to michelou/dotty that referenced this issue Apr 25, 2022
scala#14783 shows an example where an implicit reference was generated that started in a type.
The backend then crashed since it could not emit instructions to load that reference. We
now detect such references when they are created and flag them as errors.

We need to separately fix the issue that created the bad reference in the first place.
odersky added a commit to dotty-staging/dotty that referenced this issue Sep 27, 2022
Be still more careful when intersecting info and arguments of a class type parameter.
This is the latest installment of a never-ending story.

The problem is this: Given
```scala
class C[T >: L1 <: H1] { val x: T }
def f(): C[? >: L2 <: H2]
```
what is the type of `f().x`?

With capture conversion (an extremely tricky aspect of the type system forced on us
since Java does it), the type is something like `?1.T` where `?1` is a skolem variable
of type `C[? >: L2 <: H2]`. OK, but what is the underlying (widened) type of `?1.T`?

We used to say it's `C[T >: L1 <: H1]`. I.e. we forgot about the actual arguments.
But then we had to change untupling desugarings from defs to vals in scala#14816 to fix
scala#14783 and it turned out that was not good enough, we needed the information of the
actual arguments, i.e. the type should be `C[T >: L2 <: H2]. Then something else started
failing which relied on the formal arguiment bounds being preserved. So the new resolution
was that the type would be the intersection of the formal parameter bounds and the actual
bounds, i.e. `C[T >: L1 | L2 <: H1 & H2]`. Then there was a series of problems where _that_
failed, either because the parameter bound was F-bounded or because the intersection was an
empty type. The latest installment is that the parameter bounds refer to another parameter
in the same class, which requires a simultaneous substitution of all skolemized bounds for
all dependent parameter references in the parameter bounds. But that's impossible or at least
very hard to achieve since we are looking at the type of a single parameter after capture conversion here.
So the current solution is to also back out of the intersection if there are cross-parameter
references and to use just the argument bounds instead.
odersky added a commit that referenced this issue Sep 27, 2022
…16112)

Be still more careful when intersecting info and arguments of a class
type parameter. This is the latest installment of a never-ending story.

The problem is this: Given
```scala
class C[T >: L1 <: H1] { val x: T }
def f(): C[? >: L2 <: H2]
```
what is the type of `f().x`?

With capture conversion (an extremely tricky aspect of the type system
forced on us since Java does it), the type is something like `?1.T`
where `?1` is a skolem variable of type `C[? >: L2 <: H2]`. OK, but what
is the underlying (widened) type of `?1.T`?

We used to say it's `C[T >: L1 <: H1]`. I.e. we forgot about the actual
arguments. But then we had to change untupling desugarings from defs to
vals in #14816 to fix #14783 and it turned out that was not good enough,
we needed the information of the actual arguments, i.e. the type should
be `C[T >: L2 <: H2]`. Then something else started failing which relied
on the formal arguiment bounds being preserved. So the new resolution
was that the type would be the intersection of the formal parameter
bounds and the actual bounds, i.e. `C[T >: L1 | L2 <: H1 & H2]`. Then
there was a series of problems where _that_ failed, either because the
parameter bound was F-bounded or because the intersection was an empty
type. The latest installment is that the parameter bounds refer to
another parameter in the same class, which requires a simultaneous
substitution of all skolemized bounds for all dependent parameter
references in the parameter bounds. But that's impossible or at least
very hard to achieve since we are looking at the type of a single
parameter after capture conversion here. So the current solution is to
also back out of the intersection if there are cross-parameter
references and to use just the argument bounds instead.
mpollmeier pushed a commit to mpollmeier/dotty that referenced this issue Oct 16, 2022
Be still more careful when intersecting info and arguments of a class type parameter.
This is the latest installment of a never-ending story.

The problem is this: Given
```scala
class C[T >: L1 <: H1] { val x: T }
def f(): C[? >: L2 <: H2]
```
what is the type of `f().x`?

With capture conversion (an extremely tricky aspect of the type system forced on us
since Java does it), the type is something like `?1.T` where `?1` is a skolem variable
of type `C[? >: L2 <: H2]`. OK, but what is the underlying (widened) type of `?1.T`?

We used to say it's `C[T >: L1 <: H1]`. I.e. we forgot about the actual arguments.
But then we had to change untupling desugarings from defs to vals in scala#14816 to fix
scala#14783 and it turned out that was not good enough, we needed the information of the
actual arguments, i.e. the type should be `C[T >: L2 <: H2]. Then something else started
failing which relied on the formal arguiment bounds being preserved. So the new resolution
was that the type would be the intersection of the formal parameter bounds and the actual
bounds, i.e. `C[T >: L1 | L2 <: H1 & H2]`. Then there was a series of problems where _that_
failed, either because the parameter bound was F-bounded or because the intersection was an
empty type. The latest installment is that the parameter bounds refer to another parameter
in the same class, which requires a simultaneous substitution of all skolemized bounds for
all dependent parameter references in the parameter bounds. But that's impossible or at least
very hard to achieve since we are looking at the type of a single parameter after capture conversion here.
So the current solution is to also back out of the intersection if there are cross-parameter
references and to use just the argument bounds instead.
Kordyjan pushed a commit to dotty-staging/dotty that referenced this issue Oct 17, 2022
Be still more careful when intersecting info and arguments of a class type parameter.
This is the latest installment of a never-ending story.

The problem is this: Given
```scala
class C[T >: L1 <: H1] { val x: T }
def f(): C[? >: L2 <: H2]
```
what is the type of `f().x`?

With capture conversion (an extremely tricky aspect of the type system forced on us
since Java does it), the type is something like `?1.T` where `?1` is a skolem variable
of type `C[? >: L2 <: H2]`. OK, but what is the underlying (widened) type of `?1.T`?

We used to say it's `C[T >: L1 <: H1]`. I.e. we forgot about the actual arguments.
But then we had to change untupling desugarings from defs to vals in scala#14816 to fix
scala#14783 and it turned out that was not good enough, we needed the information of the
actual arguments, i.e. the type should be `C[T >: L2 <: H2]. Then something else started
failing which relied on the formal arguiment bounds being preserved. So the new resolution
was that the type would be the intersection of the formal parameter bounds and the actual
bounds, i.e. `C[T >: L1 | L2 <: H1 & H2]`. Then there was a series of problems where _that_
failed, either because the parameter bound was F-bounded or because the intersection was an
empty type. The latest installment is that the parameter bounds refer to another parameter
in the same class, which requires a simultaneous substitution of all skolemized bounds for
all dependent parameter references in the parameter bounds. But that's impossible or at least
very hard to achieve since we are looking at the type of a single parameter after capture conversion here.
So the current solution is to also back out of the intersection if there are cross-parameter
references and to use just the argument bounds instead.
@Kordyjan Kordyjan modified the milestones: 3.2.2, 3.2.0 Aug 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment