Skip to content

Conversation

@retronym
Copy link
Owner

@retronym retronym commented Sep 12, 2023

object Repro {

  trait O1[O1_A] {
    type O1_A_Alias = O1_A
    trait I1[I1_A] {
      type I1_A_Alias = I1_A
      def foo(__DEBUG__o1_a: O1_A_Alias, i1_A: I1_A_Alias): Unit = ()
    }
  }

  trait O2 extends O1[Int] {
    trait I2 extends I1[String] with O1[Nothing] {
      self: X =>
      self./*resolved: true*/foo(1, "")
    }
  }
  trait X
}
qscalac -d /tmp -Ystop-after:typer /Users/jz/code/intellij-scala/scala/scala-impl/testdata/resolve2/bug/SCL21585D.scala

>> new AsSeenFromMap(I2.this.type, trait I1)
    >> apply((__DEBUG__o1_a: O1.this.O1_A_Alias, i1_A: I1.this.I1_A_Alias): Unit)
        >> apply(O1.this.O1_A_Alias)
            >> apply(O1.this.type)
                >> thisTypeAsSeen(O1.this.type)
                    >> thisTypeAsSeen::loop(I2.this.type, trait I1)
                        >> matchesPrefixAndClass(I2.this.type, trait I1, trait O1)
                        << false
                        >> thisTypeAsSeen::loop(O2.this.type, trait O1)
                            >> matchesPrefixAndClass(O2.this.type, trait O1, trait O1)
                            << true
                        << O2.this.type
                    << O2.this.type
                << O2.this.type
            << O2.this.type
        << O2.this.O1_A_Alias
        >> apply(O1.this.O1_A_Alias)
            >> apply(O1.this.type)
                >> thisTypeAsSeen(O1.this.type)
                    >> thisTypeAsSeen::loop(I2.this.type, trait I1)
                        >> matchesPrefixAndClass(I2.this.type, trait I1, trait O1)
                        << false
                        >> thisTypeAsSeen::loop(O2.this.type, trait O1)
                            >> matchesPrefixAndClass(O2.this.type, trait O1, trait O1)
                            << true
                        << O2.this.type
                    << O2.this.type
                << O2.this.type
            << O2.this.type
        << O2.this.O1_A_Alias
        >> apply(I1.this.I1_A_Alias)
            >> apply(I1.this.type)
                >> thisTypeAsSeen(I1.this.type)
                    >> thisTypeAsSeen::loop(I2.this.type, trait I1)
                        >> matchesPrefixAndClass(I2.this.type, trait I1, trait I1)
                        << true
                    << I2.this.type
                << I2.this.type
            << I2.this.type
        << I2.this.I1_A_Alias
        >> apply(Unit)
            >> apply(scala.type)
                >> thisTypeAsSeen(scala.type)
                    >> thisTypeAsSeen::loop(I2.this.type, trait I1)
                    << scala.type
                << scala.type
            << scala.type
        << Unit
    << (__DEBUG__o1_a: O2.this.O1_A_Alias, i1_A: I2.this.I1_A_Alias): Unit
<< (__DEBUG__o1_a: O2.this.O1_A_Alias, i1_A: I2.this.I1_A_Alias): Unit

@retronym
Copy link
Owner Author

polymorphicType(ScSubstitutor(`this` -> I2.this.type >> Map(I1_A -> String) >> `this` -> I2.this.type >> `this` -> Repro.O2 >> `this` -> Repro.O2 >> Map(O1_A -> Int) >> `this` -> O2.this.type >> `this` -> Repro.this.type >> `this` -> Repro.O2 >> `this` -> Repro.type), (O1.this.O1_A_Alias, I1.this.I1_A_Alias) => Unit)
  -> SubTypeUpdater.updateSubtypes((O1.this.O1_A_Alias, I1.this.I1_A_Alias) => Unit, covariant, ScSubstitutor(`this` -> I2.this.type >> Map(I1_A -> String) >> `this` -> I2.this.type >> `this` -> Repro.O2 >> `this` -> Repro.O2 >> Map(O1_A -> Int) >> `this` -> O2.this.type >> `this` -> Repro.this.type >> `this` -> Repro.O2 >> `this` -> Repro.type))
    -> SubTypeUpdater.updateSubtypes(O1.this.O1_A_Alias, contravariant, ScSubstitutor(`this` -> I2.this.type >> Map(I1_A -> String) >> `this` -> I2.this.type >> `this` -> Repro.O2 >> `this` -> Repro.O2 >> Map(O1_A -> Int) >> `this` -> O2.this.type >> `this` -> Repro.this.type >> `this` -> Repro.O2 >> `this` -> Repro.type))
      -> ThisTypeSubstitution(O1.this.type, I2.this.type
      == I2.this.type
      -> ThisTypeSubstitution(I2.this.type, I2.this.type
      == I2.this.type
      -> ThisTypeSubstitution(I2.this.type, Repro.O2
        -> ThisTypeSubstitution(I2.this.type, Repro.type
        == I2.this.type
      == I2.this.type
      -> ThisTypeSubstitution(I2.this.type, Repro.O2
        -> ThisTypeSubstitution(I2.this.type, Repro.type
        == I2.this.type
      == I2.this.type
      -> ThisTypeSubstitution(I2.this.type, O2.this.type
        -> ThisTypeSubstitution(I2.this.type, Repro.this.type
        == I2.this.type
      == I2.this.type
      -> ThisTypeSubstitution(I2.this.type, Repro.this.type
      == I2.this.type
      -> ThisTypeSubstitution(I2.this.type, Repro.O2
        -> ThisTypeSubstitution(I2.this.type, Repro.type
        == I2.this.type
      == I2.this.type
      -> ThisTypeSubstitution(I2.this.type, Repro.type
      == I2.this.type
    == I2.this.O1_A_Alias
    -> SubTypeUpdater.updateSubtypes(O1.this.O1_A_Alias, contravariant, ScSubstitutor(`this` -> I2.this.type >> Map(I1_A -> String) >> `this` -> I2.this.type >> `this` -> Repro.O2 >> `this` -> Repro.O2 >> Map(O1_A -> Int) >> `this` -> O2.this.type >> `this` -> Repro.this.type >> `this` -> Repro.O2 >> `this` -> Repro.type))
      -> ThisTypeSubstitution(O1.this.type, I2.this.type
      == I2.this.type
      -> ThisTypeSubstitution(I2.this.type, I2.this.type
      == I2.this.type
      -> ThisTypeSubstitution(I2.this.type, Repro.O2
        -> ThisTypeSubstitution(I2.this.type, Repro.type
        == I2.this.type
      == I2.this.type
      -> ThisTypeSubstitution(I2.this.type, Repro.O2
        -> ThisTypeSubstitution(I2.this.type, Repro.type
        == I2.this.type
      == I2.this.type
      -> ThisTypeSubstitution(I2.this.type, O2.this.type
        -> ThisTypeSubstitution(I2.this.type, Repro.this.type
        == I2.this.type
      == I2.this.type
      -> ThisTypeSubstitution(I2.this.type, Repro.this.type
      == I2.this.type
      -> ThisTypeSubstitution(I2.this.type, Repro.O2
        -> ThisTypeSubstitution(I2.this.type, Repro.type
        == I2.this.type
      == I2.this.type
      -> ThisTypeSubstitution(I2.this.type, Repro.type
      == I2.this.type
    == I2.this.O1_A_Alias
    -> SubTypeUpdater.updateSubtypes(I1.this.I1_A_Alias, contravariant, ScSubstitutor(`this` -> I2.this.type >> Map(I1_A -> String) >> `this` -> I2.this.type >> `this` -> Repro.O2 >> `this` -> Repro.O2 >> Map(O1_A -> Int) >> `this` -> O2.this.type >> `this` -> Repro.this.type >> `this` -> Repro.O2 >> `this` -> Repro.type))
      -> ThisTypeSubstitution(I1.this.type, I2.this.type
      == I2.this.type
      -> ThisTypeSubstitution(I2.this.type, I2.this.type
      == I2.this.type
      -> ThisTypeSubstitution(I2.this.type, Repro.O2
        -> ThisTypeSubstitution(I2.this.type, Repro.type
        == I2.this.type
      == I2.this.type
      -> ThisTypeSubstitution(I2.this.type, Repro.O2
        -> ThisTypeSubstitution(I2.this.type, Repro.type
        == I2.this.type
      == I2.this.type
      -> ThisTypeSubstitution(I2.this.type, O2.this.type
        -> ThisTypeSubstitution(I2.this.type, Repro.this.type
        == I2.this.type
      == I2.this.type
      -> ThisTypeSubstitution(I2.this.type, Repro.this.type
      == I2.this.type
      -> ThisTypeSubstitution(I2.this.type, Repro.O2
        -> ThisTypeSubstitution(I2.this.type, Repro.type
        == I2.this.type
      == I2.this.type
      -> ThisTypeSubstitution(I2.this.type, Repro.type
      == I2.this.type
    == I2.this.I1_A_Alias
    -> SubTypeUpdater.updateSubtypes(I1.this.I1_A_Alias, contravariant, ScSubstitutor(`this` -> I2.this.type >> Map(I1_A -> String) >> `this` -> I2.this.type >> `this` -> Repro.O2 >> `this` -> Repro.O2 >> Map(O1_A -> Int) >> `this` -> O2.this.type >> `this` -> Repro.this.type >> `this` -> Repro.O2 >> `this` -> Repro.type))
      -> ThisTypeSubstitution(I1.this.type, I2.this.type
      == I2.this.type
      -> ThisTypeSubstitution(I2.this.type, I2.this.type
      == I2.this.type
      -> ThisTypeSubstitution(I2.this.type, Repro.O2
        -> ThisTypeSubstitution(I2.this.type, Repro.type
        == I2.this.type
      == I2.this.type
      -> ThisTypeSubstitution(I2.this.type, Repro.O2
        -> ThisTypeSubstitution(I2.this.type, Repro.type
        == I2.this.type
      == I2.this.type
      -> ThisTypeSubstitution(I2.this.type, O2.this.type
        -> ThisTypeSubstitution(I2.this.type, Repro.this.type
        == I2.this.type
      == I2.this.type
      -> ThisTypeSubstitution(I2.this.type, Repro.this.type
      == I2.this.type
      -> ThisTypeSubstitution(I2.this.type, Repro.O2
        -> ThisTypeSubstitution(I2.this.type, Repro.type
        == I2.this.type
      == I2.this.type
      -> ThisTypeSubstitution(I2.this.type, Repro.type
      == I2.this.type
    == I2.this.I1_A_Alias
  == (I2.this.O1_A_Alias, I2.this.I1_A_Alias) => Unit
== (I2.this.O1_A_Alias, I2.this.I1_A_Alias) => Unit

@retronym
Copy link
Owner Author

@retronym retronym force-pushed the logged-as-seen-from branch 5 times, most recently from 766d7b0 to 20da4bd Compare December 15, 2023 04:18
@retronym retronym force-pushed the logged-as-seen-from branch from 20da4bd to 98ef469 Compare December 15, 2023 04:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants