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

Hotfix 3.3.3 #19818

Merged
merged 5 commits into from
Feb 29, 2024
Merged

Hotfix 3.3.3 #19818

merged 5 commits into from
Feb 29, 2024

Conversation

Kordyjan
Copy link
Contributor

Fixes #19815

contents:

  • [c5169f0] - fix by @smarter
  • [1f5a667] - forward and backward compatibility tests (by @bishabosha). Probably, it's overkill, but it's better to be paranoid than sorry. They only take a few seconds.
  • [df10488] - a copy of the 3.3.2 changelog with annotation about the hotfix.
  • [e497a42] - version bump. I decided to stay on 3.3.1 as a reference version and version that we check the compatibility against.


## Linting

- Wunused: Only use type treverser for checking refinements in refined type trees [#17929](https://github.com/lampepfl/dotty/pull/17929)

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: "treverser" should probably be "traverser"

@Kordyjan Kordyjan merged commit 46683d0 into release-3.3.3 Feb 29, 2024
7 of 13 checks passed
@Kordyjan Kordyjan deleted the hotfix-3.3.3 branch February 29, 2024 09:35
@bishabosha
Copy link
Member

bishabosha commented Feb 29, 2024

@Kordyjan just a note on this fix, I think we should still do something about the unique name counters for 3.4, it seems ultimately it works due to shadowing rules, but you do get some weird code gen:

class Test {
  def foo[T: Numeric]: String ?=> T = summon[Numeric[T]].fromInt(summon[String].length)
}

by typer we have

package <empty> {
  class Test() extends Object() {
    def foo[T >: Nothing <: Any](implicit evidence$1: Numeric[T]):
      (String) ?=> T =
      {
        def $anonfun(using evidence$1: String): T =
          evidence$1.fromInt(evidence$1.length())
        closure($anonfun)
      }
  }
}

i.e. evidence$1.fromInt(evidence$1.length()) looks very strange, however this seems to be safe because its encoded with direct symbol references when you reach TASTy

    86:         BLOCK(57)
    88:           LAMBDA(2)
    90:             TERMREFdirect 92
    92:           DEFDEF(51) 23 [$anonfun]
    95:             PARAM(4) 17 [[Unique evidence$ 1]]
    98:               SHAREDtype 76
   100:               GIVEN
   101:             SHAREDtype 65
   103:             APPLY(38)
   105:               SELECTin(17) 27 [fromInt[Signed Signature(List(scala.Int),java.lang.Object) @fromInt]]
   108:                 INLINED(10)
   110:                   INLINED(2)
   112:                     TERMREFdirect 50  // ref to the parameter evidence$1
   114:                   IDENTtpt 28 [Predef[ModuleClass]]
   116:                     TYPEREF 28 [Predef[ModuleClass]]
   118:                       SHAREDtype 30
   120:                 TYPEREF 18 [Numeric]
   122:                   TERMREFpkg 30 [scala[Qualified . math]]
   124:               APPLY(17)
   126:                 SELECTin(15) 32 [length[Signed Signature(List(),scala.Int) @length]]
   129:                   INLINED(8)
   131:                     INLINED(2)
   133:                       TERMREFdirect 95 // ref to the parameter evidence$1
   135:                     IDENTtpt 28 [Predef[ModuleClass]]
   137:                       SHAREDtype 116
   139:                   TYPEREF 21 [String]
   141:                     SHAREDtype 20

then by genBCode we have flattened the parameter lists

package <empty> {
  @SourceFile("Test.scala") class Test extends Object {
    def <init>(): Unit =
      {
        super()
        ()
      }
    @ContextResultCount(1) def foo(implicit evidence$1: scala.math.Numeric,
      evidence$1: String): Object = evidence$1.fromInt(evidence$1.length())
  }
}

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.

None yet

5 participants