Skip to content

Commit

Permalink
preserve generic param names in scala3
Browse files Browse the repository at this point in the history
  • Loading branch information
lihaoyi committed Feb 14, 2024
1 parent 050c894 commit 2b3925e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions build.sc
Original file line number Diff line number Diff line change
Expand Up @@ -146,15 +146,15 @@ trait UnrollModule extends Cross.Module[String]{
}

object jvm extends InnerScalaModule with ComparativePlatformScalaModule{
def unmanagedClasspath = Agg(upstreamTest.jvm.test.compile().classes, upstream.jvm.compile().classes)
def runClasspath = Seq(upstreamTest.jvm.test.compile().classes, upstream.jvm.compile().classes)
}

object js extends InnerScalaJsModule with ComparativePlatformScalaModule{
def unmanagedClasspath = Agg(upstreamTest.js.test.compile().classes, upstream.js.compile().classes)
def runClasspath = Seq(upstreamTest.js.test.compile().classes, upstream.js.compile().classes)
}

object native extends InnerScalaNativeModule with ComparativePlatformScalaModule{
def unmanagedClasspath = Agg(upstreamTest.native.test.compile().classes, upstream.native.compile().classes)
def runClasspath = Seq(upstreamTest.native.test.compile().classes, upstream.native.compile().classes)
}
}

Expand Down
2 changes: 1 addition & 1 deletion unroll/plugin/src-3/UnrollPhaseScala3.scala
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class UnrollPhaseScala3() extends PluginPhase {

def truncateMethodType0(tpe: Type): Type = {
tpe match{
case pt: PolyType => PolyType(pt.paramInfos, truncateMethodType0(pt.resType))
case pt: PolyType => PolyType(pt.paramNames, pt.paramInfos, truncateMethodType0(pt.resType))
case mt: MethodType => MethodType(mt.paramInfos.take(paramIndex), mt.resType)
}
}
Expand Down
2 changes: 1 addition & 1 deletion unroll/tests/abstractClassMethod/v2/src/Unrolled.scala
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,4 @@ object Unrolled extends Unrolled{

class UnrolledCls extends Unrolled{
def foo(s: String, n: Int = 1, b: Boolean = true) = s + n + b
}
}

0 comments on commit 2b3925e

Please sign in to comment.