Skip to content

Commit f224aad

Browse files
committed
More fixes
1 parent 45cba37 commit f224aad

File tree

9 files changed

+14
-14
lines changed

9 files changed

+14
-14
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
scala> def f(given erased a: Int): Int = ???
2-
def f(given erased a: Int): Int
2+
def f given erased (a: Int): Int

language-server/test/dotty/tools/languageserver/util/CodeTester.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,7 @@ class CodeTester(projects: List[Project]) {
237237

238238
private def doAction(action: Action): this.type = {
239239
try {
240-
action.execute() given (testServer, testServer.client, positions)
240+
action.execute()(given testServer, testServer.client, positions)
241241
} catch {
242242
case ex: AssertionError =>
243243
val sourcesStr =
@@ -252,7 +252,7 @@ class CodeTester(projects: List[Project]) {
252252
|
253253
|$sourcesStr
254254
|
255-
|while executing action: ${action.show given positions}
255+
|while executing action: ${action.show(given positions)}
256256
|
257257
""".stripMargin
258258
val assertionError = new AssertionError(msg + ex.getMessage)

tests/neg/i4044a.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ def test(given QuoteContext) = {
88
a // error
99
$a
1010
'{$a} // error
11-
'{(given QuoteContext) = ???; '{$a} } // error
11+
'{ given QuoteContext =???; '{$a} } // error
1212
}
1313

1414
}

tests/neg/i4044b.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ def test(given QuoteContext) = {
1313
b // error
1414
${b}
1515
${ '{b} } // error
16-
'{(given QuoteContext) = ???; '{$b} } // error
16+
'{ given QuoteContext =???; '{$b} } // error
1717
}
1818

1919
}

tests/patmat/i6255b.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
class Foo {
2-
def foo(x: quoted.Expr[Int]) given scala.quoted.QuoteContext: Unit = x match {
2+
def foo(x: quoted.Expr[Int])(given scala.quoted.QuoteContext): Unit = x match {
33
case '{ 1 } =>
44
case '{ 2 } =>
55
}

tests/run-staging/i5152.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ object Test {
55
given Toolbox = Toolbox.make(getClass.getClassLoader)
66
def eval1(ff: Expr[Int => Int])(given QuoteContext): Expr[Int => Int] = '{identity}
77

8-
def peval1()given QuoteContext: Expr[Unit] = '{
8+
def peval1()(given QuoteContext): Expr[Unit] = '{
99
lazy val f: Int => Int = ${eval1('{(y: Int) => f(y)})}
1010
}
1111

tests/run-staging/shonan-hmm-simple.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,13 @@ class RingComplex[U](u: Ring[U]) extends Ring[Complex[U]] {
3535
}
3636

3737
sealed trait PV[T] {
38-
def expr given Liftable[T], QuoteContext: Expr[T]
38+
def expr(given Liftable[T], QuoteContext): Expr[T]
3939
}
4040
case class Sta[T](x: T) extends PV[T] {
41-
def expr given Liftable[T], QuoteContext: Expr[T] = x
41+
def expr(given Liftable[T], QuoteContext): Expr[T] = x
4242
}
4343
case class Dyn[T](x: Expr[T]) extends PV[T] {
44-
def expr given Liftable[T], QuoteContext: Expr[T] = x
44+
def expr(given Liftable[T], QuoteContext): Expr[T] = x
4545
}
4646

4747
class RingPV[U: Liftable](u: Ring[U], eu: Ring[Expr[U]])(given QuoteContext) extends Ring[PV[U]] {

tests/run-with-compiler-custom-args/tasty-interpreter/interpreter/TastyInterpreter.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class TastyInterpreter extends TastyConsumer {
1414
case DefDef("main", _, _, _, Some(rhs)) =>
1515
val interpreter = new jvm.Interpreter(reflect)
1616

17-
interpreter.eval(rhs) given Map.empty
17+
interpreter.eval(rhs)(given Map.empty)
1818
// TODO: recurse only for PackageDef, ClassDef
1919
case tree =>
2020
super.traverseTree(tree)

tests/run-with-compiler-custom-args/tasty-interpreter/interpreter/TreeInterpreter.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ abstract class TreeInterpreter[R <: Reflection & Singleton](val reflect: R) {
6565
def interpretBlock(stats: List[Statement], expr: Term): Result = {
6666
val newEnv = stats.foldLeft(implicitly[Env])((accEnv, stat) => stat match {
6767
case ValDef(name, tpt, Some(rhs)) =>
68-
def evalRhs = eval(rhs) given accEnv
68+
def evalRhs = eval(rhs)(given accEnv)
6969
val evalRef: LocalValue =
7070
if (stat.symbol.flags.is(Flags.Lazy)) LocalValue.lazyValFrom(evalRhs)
7171
else if (stat.symbol.flags.is(Flags.Mutable)) LocalValue.varFrom(evalRhs)
@@ -76,10 +76,10 @@ abstract class TreeInterpreter[R <: Reflection & Singleton](val reflect: R) {
7676
// TODO: record the environment for closure purposes
7777
accEnv
7878
case stat =>
79-
eval(stat) given accEnv
79+
eval(stat)(given accEnv)
8080
accEnv
8181
})
82-
eval(expr) given newEnv
82+
eval(expr)(given newEnv)
8383
}
8484

8585
def interpretUnit(): AbstractAny

0 commit comments

Comments
 (0)