Skip to content

Commit 7669878

Browse files
committed
Upgrade to Scala 3.0.0-RC1
1 parent cbb6c43 commit 7669878

File tree

28 files changed

+43
-52
lines changed

28 files changed

+43
-52
lines changed

build.sc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import $file.example.websockets3.build
2727
import $file.example.websockets4.build
2828

2929
val scala213 = "2.13.4"
30-
val scala3 = "3.0.0-M3"
30+
val scala3 = "3.0.0-RC1"
3131
val dottyCustomVersion = Option(sys.props("dottyVersion"))
3232

3333
trait CaskModule extends CrossScalaModule with PublishModule{

cask/src-3/cask/router/Macros.scala

Lines changed: 17 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ object Macros {
4545

4646
val idents = method.owner.tree.asInstanceOf[ClassDef].body
4747
idents.foreach{
48-
case deff @ DefDef(Name(idx), _, _, _, tree) =>
48+
case deff @ DefDef(Name(idx), _, _, _) =>
4949
val expr = Ref(deff.symbol).asExpr
5050
defaults += (params(idx.toInt - 1) -> expr)
5151
case _ =>
@@ -65,7 +65,7 @@ object Macros {
6565
val paramTpt = param.tree.asInstanceOf[ValDef].tpt
6666
val inputReaderTypeRaw = Applied(
6767
TypeSelect(
68-
Term.of(decorator),
68+
decorator.asTerm,
6969
"InputParser"
7070
),
7171
List(paramTpt)
@@ -123,7 +123,7 @@ object Macros {
123123
val e = '{
124124
$argss(${Expr(i)})(${Expr(j)}).asInstanceOf[$t]
125125
}
126-
Term.of(e)
126+
e.asTerm
127127
}
128128
}
129129

@@ -150,29 +150,23 @@ object Macros {
150150
): Expr[Any] = {
151151
import qctx.reflect._
152152

153-
val innerReturnedTpt = TypeSelect(
154-
Term.of(endpoint),
155-
"InnerReturnedAlias"
156-
)
157-
158-
val rtpt = method.tree.asInstanceOf[DefDef].returnTpt
153+
val innerReturnedTpt = endpoint.asTerm.tpe.asType match {
154+
case '[Endpoint[_, innerReturned, _]] => TypeRepr.of(using '[innerReturned])
155+
case _ => ???
156+
}
159157

160-
val conversionTpeRaw = Applied(
161-
TypeTree.of[cask.internal.Conversion],
162-
List(
163-
rtpt, innerReturnedTpt
164-
)
165-
).tpe
158+
val rtp = method.tree.asInstanceOf[DefDef].returnTpt.tpe
166159

167-
// the asInstanceOf is required to splice this back into an Expr; this is generally
168-
// unsafe, but we know that it will work in the context that this macro is invoked in
169-
val conversionTpe = conversionTpeRaw.asType.asInstanceOf[Type[Any]]
160+
val conversionTpe = TypeRepr.of[cask.internal.Conversion].appliedTo(
161+
List(rtp, innerReturnedTpt)
162+
)
170163

171-
val conversion = Expr.summon(using conversionTpe) match {
172-
case None =>
173-
report.error(s"can't convert ${rtpt.tpe.typeSymbol.fullName} to a response", method.pos.get)
164+
val conversion = Implicits.search(conversionTpe) match {
165+
case iss: ImplicitSearchSuccess =>
166+
iss.tree.asExpr
167+
case isf: ImplicitSearchFailure =>
168+
report.error(s"can't convert ${rtp.typeSymbol.fullName} to a response", method.pos.get)
174169
'{???}
175-
case Some(expr) => expr
176170
}
177171

178172
'{
@@ -228,7 +222,7 @@ object Macros {
228222
val decoTpe = (decorator match {
229223
case Some(deco) =>
230224
TypeSelect(
231-
Term.of(deco),
225+
deco.asTerm,
232226
"InputTypeAlias"
233227
).tpe.asType
234228
case None =>

cask/src/cask/router/Decorators.scala

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,6 @@ trait RawDecorator extends Decorator[Response.Raw, Response.Raw, Any]{
8181
trait Endpoint[OuterReturned, InnerReturned, Input]
8282
extends Decorator[OuterReturned, InnerReturned, Input]{
8383

84-
// used internally to facilitate access to the type in macros
85-
type InnerReturnedAlias = InnerReturned
86-
8784
/**
8885
* What is the path that this particular endpoint matches?
8986
*/

example/compress/build.sc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ trait AppModule extends CrossScalaModule{
1010
def testFrameworks = Seq("utest.runner.Framework")
1111

1212
def ivyDeps = Agg(
13-
ivy"com.lihaoyi::utest::0.7.5",
13+
ivy"com.lihaoyi::utest::0.7.7",
1414
ivy"com.lihaoyi::requests::0.6.5",
1515
)
1616
}

example/compress2/build.sc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ trait AppModule extends CrossScalaModule{
99
def testFrameworks = Seq("utest.runner.Framework")
1010

1111
def ivyDeps = Agg(
12-
ivy"com.lihaoyi::utest::0.7.5",
12+
ivy"com.lihaoyi::utest::0.7.7",
1313
ivy"com.lihaoyi::requests::0.6.5",
1414
)
1515
}

example/compress3/build.sc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ trait AppModule extends CrossScalaModule{
99
def testFrameworks = Seq("utest.runner.Framework")
1010

1111
def ivyDeps = Agg(
12-
ivy"com.lihaoyi::utest::0.7.5",
12+
ivy"com.lihaoyi::utest::0.7.7",
1313
ivy"com.lihaoyi::requests::0.6.5",
1414
)
1515
}

example/cookies/build.sc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ trait AppModule extends CrossScalaModule{
99
def testFrameworks = Seq("utest.runner.Framework")
1010

1111
def ivyDeps = Agg(
12-
ivy"com.lihaoyi::utest::0.7.5",
12+
ivy"com.lihaoyi::utest::0.7.7",
1313
ivy"com.lihaoyi::requests::0.6.5",
1414
)
1515
}

example/decorated/build.sc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ trait AppModule extends CrossScalaModule{
99
def testFrameworks = Seq("utest.runner.Framework")
1010

1111
def ivyDeps = Agg(
12-
ivy"com.lihaoyi::utest::0.7.5",
12+
ivy"com.lihaoyi::utest::0.7.7",
1313
ivy"com.lihaoyi::requests::0.6.5",
1414
)
1515
}

example/decorated2/build.sc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ trait AppModule extends CrossScalaModule{
99
def testFrameworks = Seq("utest.runner.Framework")
1010

1111
def ivyDeps = Agg(
12-
ivy"com.lihaoyi::utest::0.7.5",
12+
ivy"com.lihaoyi::utest::0.7.7",
1313
ivy"com.lihaoyi::requests::0.6.5",
1414
)
1515
}

example/endpoints/build.sc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ trait AppModule extends CrossScalaModule{
99
def testFrameworks = Seq("utest.runner.Framework")
1010

1111
def ivyDeps = Agg(
12-
ivy"com.lihaoyi::utest::0.7.5",
12+
ivy"com.lihaoyi::utest::0.7.7",
1313
ivy"com.lihaoyi::requests::0.6.5",
1414
)
1515
}

example/formJsonPost/build.sc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ trait AppModule extends CrossScalaModule{
99
def testFrameworks = Seq("utest.runner.Framework")
1010

1111
def ivyDeps = Agg(
12-
ivy"com.lihaoyi::utest::0.7.5",
12+
ivy"com.lihaoyi::utest::0.7.7",
1313
ivy"com.lihaoyi::requests::0.6.5"
1414
)
1515
}

example/httpMethods/build.sc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ trait AppModule extends CrossScalaModule{
99
def testFrameworks = Seq("utest.runner.Framework")
1010

1111
def ivyDeps = Agg(
12-
ivy"com.lihaoyi::utest::0.7.5",
12+
ivy"com.lihaoyi::utest::0.7.7",
1313
ivy"com.lihaoyi::requests::0.6.5",
1414
)
1515
}

example/minimalApplication/build.sc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ trait AppModule extends CrossScalaModule{
99
def testFrameworks = Seq("utest.runner.Framework")
1010

1111
def ivyDeps = Agg(
12-
ivy"com.lihaoyi::utest::0.7.5",
12+
ivy"com.lihaoyi::utest::0.7.7",
1313
ivy"com.lihaoyi::requests::0.6.5",
1414
)
1515
}

example/minimalApplication2/build.sc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ trait AppModule extends CrossScalaModule{
99
def testFrameworks = Seq("utest.runner.Framework")
1010

1111
def ivyDeps = Agg(
12-
ivy"com.lihaoyi::utest::0.7.5",
12+
ivy"com.lihaoyi::utest::0.7.7",
1313
ivy"com.lihaoyi::requests::0.6.5",
1414
)
1515
}

example/redirectAbort/build.sc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ trait AppModule extends CrossScalaModule{
99
def testFrameworks = Seq("utest.runner.Framework")
1010

1111
def ivyDeps = Agg(
12-
ivy"com.lihaoyi::utest::0.7.5",
12+
ivy"com.lihaoyi::utest::0.7.7",
1313
ivy"com.lihaoyi::requests::0.6.5",
1414
)
1515
}

example/scalatags/build.sc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ trait AppModule extends CrossScalaModule{
1111
def testFrameworks = Seq("utest.runner.Framework")
1212

1313
def ivyDeps = Agg(
14-
ivy"com.lihaoyi::utest::0.7.5",
14+
ivy"com.lihaoyi::utest::0.7.7",
1515
ivy"com.lihaoyi::requests::0.6.5",
1616
)
1717
}

example/staticFiles/build.sc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ trait AppModule extends CrossScalaModule{
1111
def testFrameworks = Seq("utest.runner.Framework")
1212

1313
def ivyDeps = Agg(
14-
ivy"com.lihaoyi::utest::0.7.5",
14+
ivy"com.lihaoyi::utest::0.7.7",
1515
ivy"com.lihaoyi::requests::0.6.5",
1616
)
1717

example/staticFiles2/build.sc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ trait AppModule extends CrossScalaModule{
1111
def testFrameworks = Seq("utest.runner.Framework")
1212

1313
def ivyDeps = Agg(
14-
ivy"com.lihaoyi::utest::0.7.5",
14+
ivy"com.lihaoyi::utest::0.7.7",
1515
ivy"com.lihaoyi::requests::0.6.5",
1616
)
1717

example/todo/build.sc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ trait AppModule extends CrossScalaModule{
1313
def testFrameworks = Seq("utest.runner.Framework")
1414

1515
def ivyDeps = Agg(
16-
ivy"com.lihaoyi::utest::0.7.5",
16+
ivy"com.lihaoyi::utest::0.7.7",
1717
ivy"com.lihaoyi::requests::0.6.5",
1818
)
1919
}

example/todoApi/build.sc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ trait AppModule extends CrossScalaModule{
99
def testFrameworks = Seq("utest.runner.Framework")
1010

1111
def ivyDeps = Agg(
12-
ivy"com.lihaoyi::utest::0.7.5",
12+
ivy"com.lihaoyi::utest::0.7.7",
1313
ivy"com.lihaoyi::requests::0.6.5",
1414
)
1515
}

example/todoDb/build.sc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ trait AppModule extends CrossScalaModule{
1212
def testFrameworks = Seq("utest.runner.Framework")
1313

1414
def ivyDeps = Agg(
15-
ivy"com.lihaoyi::utest::0.7.5",
15+
ivy"com.lihaoyi::utest::0.7.7",
1616
ivy"com.lihaoyi::requests::0.6.5",
1717
)
1818
}

example/twirl/build.sc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ trait AppModule extends CrossScalaModule with mill.twirllib.TwirlModule{
1515
def testFrameworks = Seq("utest.runner.Framework")
1616

1717
def ivyDeps = Agg(
18-
ivy"com.lihaoyi::utest::0.7.5",
18+
ivy"com.lihaoyi::utest::0.7.7",
1919
ivy"com.lihaoyi::requests::0.6.5",
2020
)
2121
}

example/variableRoutes/build.sc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ trait AppModule extends CrossScalaModule{
99
def testFrameworks = Seq("utest.runner.Framework")
1010

1111
def ivyDeps = Agg(
12-
ivy"com.lihaoyi::utest::0.7.5",
12+
ivy"com.lihaoyi::utest::0.7.7",
1313
ivy"com.lihaoyi::requests::0.6.5",
1414
)
1515
}

example/websockets/build.sc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ trait AppModule extends CrossScalaModule{
99
def testFrameworks = Seq("utest.runner.Framework")
1010

1111
def ivyDeps = Agg(
12-
ivy"com.lihaoyi::utest::0.7.5",
12+
ivy"com.lihaoyi::utest::0.7.7",
1313
ivy"com.lihaoyi::requests::0.6.5",
1414
ivy"org.asynchttpclient:async-http-client:2.5.2"
1515
)

example/websockets2/build.sc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ trait AppModule extends CrossScalaModule{
99
def testFrameworks = Seq("utest.runner.Framework")
1010

1111
def ivyDeps = Agg(
12-
ivy"com.lihaoyi::utest::0.7.5",
12+
ivy"com.lihaoyi::utest::0.7.7",
1313
ivy"com.lihaoyi::requests::0.6.5",
1414
ivy"org.asynchttpclient:async-http-client:2.5.2"
1515
)

example/websockets3/build.sc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ trait AppModule extends CrossScalaModule{
99
def testFrameworks = Seq("utest.runner.Framework")
1010

1111
def ivyDeps = Agg(
12-
ivy"com.lihaoyi::utest::0.7.5",
12+
ivy"com.lihaoyi::utest::0.7.7",
1313
ivy"com.lihaoyi::requests::0.6.5",
1414
ivy"org.asynchttpclient:async-http-client:2.5.2"
1515
)

example/websockets4/build.sc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ trait AppModule extends CrossScalaModule{
99
def testFrameworks = Seq("utest.runner.Framework")
1010

1111
def ivyDeps = Agg(
12-
ivy"com.lihaoyi::utest::0.7.5",
12+
ivy"com.lihaoyi::utest::0.7.7",
1313
ivy"com.lihaoyi::requests::0.6.5",
1414
ivy"org.asynchttpclient:async-http-client:2.5.2"
1515
)

mill

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# This is a wrapper script, that automatically download mill from GitHub release pages
44
# You can give the required mill version with MILL_VERSION env variable
55
# If no version is given, it falls back to the value of DEFAULT_MILL_VERSION
6-
DEFAULT_MILL_VERSION=0.9.4
6+
DEFAULT_MILL_VERSION=0.9.5-48-4ad87f
77

88

99
set -e

0 commit comments

Comments
 (0)