Skip to content

Commit 84a0197

Browse files
committed
Drop given parameter syntax
1 parent 82dbb9e commit 84a0197

File tree

39 files changed

+81
-109
lines changed

39 files changed

+81
-109
lines changed

community-build/test/scala/dotty/communitybuild/CommunityBuildTest.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ sealed trait CommunityProject:
4747
/** Is this project running in the test or update mode in the
4848
* context of the given suite? @see `run` for more details.
4949
*/
50-
final def isUpdateMode(given suite: CommunityBuildTest) =
50+
final def isUpdateMode(using suite: CommunityBuildTest) =
5151
suite.isInstanceOf[CommunityBuildUpdate]
5252

5353
/** Depending on the mode of operation, either
@@ -60,7 +60,7 @@ sealed trait CommunityProject:
6060
* and avoid network overhead. See https://github.com/lampepfl/dotty-drone
6161
* for more infrastructural details.
6262
*/
63-
final def run()(given suite: CommunityBuildTest) =
63+
final def run()(using suite: CommunityBuildTest) =
6464
val runCmd = if isUpdateMode then updateCommand else testCommand
6565
if !isUpdateMode then dependencies.foreach(_.publish())
6666
suite.test(project, binaryName, runCommandsArgs :+ runCmd)

compiler/src/dotty/tools/dotc/parsing/Parsers.scala

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -917,7 +917,7 @@ object Parsers {
917917
def followingIsParamOrGivenType() =
918918
val lookahead = in.LookaheadScanner()
919919
lookahead.nextToken()
920-
if startParamOrGivenTypeTokens.contains(lookahead.token)
920+
if startParamTokens.contains(lookahead.token)
921921
|| lookahead.isIdent(nme.using)
922922
then true
923923
else if lookahead.token == IDENTIFIER then
@@ -1450,8 +1450,6 @@ object Parsers {
14501450
case MATCH => matchType(t)
14511451
case FORSOME => syntaxError(ExistentialTypesNoLongerSupported()); t
14521452
case _ =>
1453-
if (imods.isOneOf(GivenOrImplicit) && !t.isInstanceOf[FunctionWithMods])
1454-
syntaxError(ImplicitTypesCanOnlyBeFunctionTypes(), implicitKwPos(start))
14551453
if (imods.is(Erased) && !t.isInstanceOf[FunctionWithMods])
14561454
syntaxError(ErasedTypesCanOnlyBeFunctionTypes(), implicitKwPos(start))
14571455
t
@@ -2299,7 +2297,7 @@ object Parsers {
22992297
def parArgumentExprs(): (List[Tree], Boolean) = inParens {
23002298
if in.token == RPAREN then
23012299
(Nil, false)
2302-
else if in.token == GIVEN || isIdent(nme.using) then
2300+
else if isIdent(nme.using) then
23032301
in.nextToken()
23042302
(commaSeparated(argumentExpr), true)
23052303
else
@@ -2786,7 +2784,7 @@ object Parsers {
27862784
normalize(loop(start))
27872785
}
27882786

2789-
val funTypeArgMods: BitSet = BitSet(GIVEN, ERASED)
2787+
val funTypeArgMods: BitSet = BitSet(ERASED)
27902788

27912789
/** Wrap annotation or constructor in New(...).<init> */
27922790
def wrapNew(tpt: Tree): Select = Select(New(tpt), nme.CONSTRUCTOR)
@@ -2912,7 +2910,7 @@ object Parsers {
29122910
def paramMods() =
29132911
if in.token == IMPLICIT then addParamMod(() => Mod.Implicit())
29142912
else
2915-
if in.token == GIVEN || isIdent(nme.using) then addParamMod(() => Mod.Given())
2913+
if isIdent(nme.using) then addParamMod(() => Mod.Given())
29162914
if in.token == ERASED then addParamMod(() => Mod.Erased())
29172915

29182916
def param(): ValDef = {

compiler/src/dotty/tools/dotc/parsing/Tokens.scala

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ object Tokens extends TokensCommon {
257257
AT, CASE)
258258

259259
final val canEndStatTokens: TokenSet = atomicExprTokens | BitSet(
260-
TYPE, GIVEN, RPAREN, RBRACE, RBRACKET, OUTDENT)
260+
TYPE, GIVEN, RPAREN, RBRACE, RBRACKET, OUTDENT) // TODO: remove GIVEN once old import syntax is dropped
261261

262262
/** Tokens that stop a lookahead scan search for a `<-`, `then`, or `do`.
263263
* Used for disambiguating between old and new syntax.
@@ -280,12 +280,6 @@ object Tokens extends TokensCommon {
280280
*/
281281
final val startParamTokens: BitSet = modifierTokens | BitSet(VAL, VAR, AT)
282282

283-
/** Faced with the choice of a type `(...)` or a parameter or given type list
284-
* in `(...)`, the following tokens after the opening `(` determine it's
285-
* a parameter or given type list.
286-
*/
287-
final val startParamOrGivenTypeTokens: BitSet = startParamTokens | BitSet(GIVEN, ERASED)
288-
289283
final val scala3keywords = BitSet(ENUM, ERASED, GIVEN)
290284

291285
final val softModifierNames = Set(nme.inline, nme.opaque, nme.open)

compiler/src/dotty/tools/dotc/reporting/diagnostic/ErrorMessageID.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ enum ErrorMessageID extends java.lang.Enum[ErrorMessageID] {
150150
UnknownNamedEnclosingClassOrObjectID,
151151
IllegalCyclicTypeReferenceID,
152152
MissingTypeParameterInTypeAppID,
153-
ImplicitTypesCanOnlyBeFunctionTypesID,
153+
UNUSED_ImplicitTypesCanOnlyBeFunctionTypesID,
154154
ErasedTypesCanOnlyBeFunctionTypesID,
155155
CaseClassMissingNonImplicitParamListID,
156156
EnumerationsShouldNotBeEmptyID,

compiler/src/dotty/tools/dotc/reporting/diagnostic/messages.scala

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2376,17 +2376,10 @@ object messages {
23762376
""".stripMargin
23772377
}
23782378

2379-
case class IllegalCyclicTypeReference(sym: Symbol, where: String, lastChecked: Type)(implicit val ctx: Context)
2380-
extends Message(IllegalCyclicTypeReferenceID) {
2381-
val kind: String = "Cyclic"
2382-
val msg: String = i"illegal cyclic type reference: ${where} ${hl(lastChecked.show)} of $sym refers back to the type itself"
2383-
val explanation: String = ""
2384-
}
2385-
2386-
case class ImplicitTypesCanOnlyBeFunctionTypes()(implicit val ctx: Context) // TODO remove when (given ...) => is removed
2387-
extends Message(ImplicitTypesCanOnlyBeFunctionTypesID) {
2388-
val kind: String = "Syntax"
2389-
val msg: String = "Types with given keyword can only be function types `(given ...) => ...`"
2379+
case class IllegalCyclicTypeReference(sym: Symbol, where: String, lastChecked: Type)(implicit val ctx: Context)
2380+
extends Message(IllegalCyclicTypeReferenceID) {
2381+
val kind: String = "Cyclic"
2382+
val msg: String = i"illegal cyclic type reference: ${where} ${hl(lastChecked.show)} of $sym refers back to the type itself"
23902383
val explanation: String = ""
23912384
}
23922385

compiler/src/dotty/tools/dotc/semanticdb/ExtractSemanticDB.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ import java.nio.file.Paths
1717

1818
import PartialFunction.condOpt
1919

20-
import ast.untpd.given
21-
import NameOps.given
20+
import ast.untpd.{given _}
21+
import NameOps.{given _}
2222

2323
import scala.annotation.{ threadUnsafe => tu, tailrec }
2424

@@ -28,8 +28,8 @@ import scala.annotation.{ threadUnsafe => tu, tailrec }
2828
* TODO: Also extract type information
2929
*/
3030
class ExtractSemanticDB extends Phase with
31-
import Scala3.{_, given}
32-
import Symbols.given
31+
import Scala3.{_, given _}
32+
import Symbols.{given _}
3333

3434
override val phaseName: String = ExtractSemanticDB.name
3535

compiler/src/dotty/tools/dotc/typer/Applications.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -863,7 +863,7 @@ trait Applications extends Compatibility {
863863
new ApplyToTyped(tree, fun1, funRef, proto.typedArgs(), pt)
864864
else
865865
new ApplyToUntyped(tree, fun1, funRef, proto, pt)(
866-
given fun1.nullableInArgContext(using argCtx(tree)))
866+
using fun1.nullableInArgContext(using argCtx(tree)))
867867
convertNewGenericArray(
868868
postProcessByNameArgs(funRef, app.result).computeNullable())
869869
case _ =>

compiler/src/dotty/tools/dotc/typer/ImportSuggestions.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ trait ImportSuggestions with
184184
try
185185
timer.schedule(task, testOneImplicitTimeOut)
186186
typedImplicit(candidate, expectedType, argument, span)(
187-
given ctx.fresh.setExploreTyperState()).isSuccess
187+
using ctx.fresh.setExploreTyperState()).isSuccess
188188
finally
189189
if task.cancel() then // timer task has not run yet
190190
assert(!ctx.run.isCancelled)

compiler/src/dotty/tools/dotc/typer/Typer.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1232,8 +1232,8 @@ class Typer extends Namer
12321232

12331233
val pat1 = typedPattern(tree.pat, wideSelType)(gadtCtx)
12341234
caseRest(pat1)(
1235-
given Nullables.caseContext(sel, pat1)(
1236-
given gadtCtx.fresh.setNewScope))
1235+
using Nullables.caseContext(sel, pat1)(
1236+
using gadtCtx.fresh.setNewScope))
12371237
}
12381238

12391239
def typedLabeled(tree: untpd.Labeled)(implicit ctx: Context): Labeled = {
@@ -2345,7 +2345,7 @@ class Typer extends Namer
23452345
// in preceding statements (unless the DefTree is completed ahead of time,
23462346
// then it is impossible).
23472347
sym.info = Completer(completer.original)(
2348-
given completer.creationContext.withNotNullInfos(ctx.notNullInfos))
2348+
using completer.creationContext.withNotNullInfos(ctx.notNullInfos))
23492349
true
23502350
case _ =>
23512351
// If it has been completed, then it must be because there is a forward reference

compiler/test-resources/repl/defs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ scala> def id(x: 4): 4 = x
1010
def id(x: 4): 4
1111
scala> id(4)
1212
val res0: Int = 4
13-
scala> def f(given Int) = 1
14-
def f(given x$1: Int): Int
13+
scala> def f(using Int) = 1
14+
def f(using x$1: Int): Int
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
scala> def f(given erased a: Int): Int = ???
2-
def f(given erased a: Int): Int
1+
scala> def f(using erased a: Int): Int = ???
2+
def f(using erased a: Int): Int

compiler/test/dotty/tools/dotc/reporting/ErrorMessagesTests.scala

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1685,23 +1685,10 @@ class ErrorMessagesTests extends ErrorMessagesTest {
16851685
assertEquals("List[X]", lastChecked.show)
16861686
}
16871687

1688-
@Test def implicitTypesCanOnlyBeFunctionTypesSuccess() =
1689-
checkMessagesAfter(RefChecks.name) ("def foo(f: (given Int) => Int): Int = 1")
1690-
.expectNoErrors
1691-
16921688
@Test def erasedTypesCanOnlyBeFunctionTypesSuccess() =
16931689
checkMessagesAfter(FrontEnd.name) ("def foo(f: (erased Int) => Int): Int = 1")
16941690
.expectNoErrors
16951691

1696-
@Test def implicitTypesCanOnlyBeFunctionTypesFailed() =
1697-
checkMessagesAfter(FrontEnd.name) ("def foo(f: (given Int)): Int = 1")
1698-
.expect { (ictx, messages) =>
1699-
implicit val ctx: Context = ictx
1700-
assertMessageCount(1, messages)
1701-
val ImplicitTypesCanOnlyBeFunctionTypes() :: Nil = messages
1702-
assertEquals("Types with given keyword can only be function types `(given ...) => ...`", messages.head.msg)
1703-
}
1704-
17051692
@Test def erasedTypesCanOnlyBeFunctionTypesFailed() =
17061693
checkMessagesAfter(FrontEnd.name) ("def foo(f: (erased Int)): Int = 1")
17071694
.expect { (ictx, messages) =>
@@ -1726,11 +1713,11 @@ class ErrorMessagesTests extends ErrorMessagesTest {
17261713
}
17271714

17281715
@Test def caseClassMissingNonImplicitParamListSuccessful =
1729-
checkMessagesAfter(FrontEnd.name) ("case class Test()(given foo: String)")
1716+
checkMessagesAfter(FrontEnd.name) ("case class Test()(using foo: String)")
17301717
.expectNoErrors
17311718

17321719
@Test def caseClassMissingNonImplicitParamListFailed =
1733-
checkMessagesAfter(FrontEnd.name) ("case class Test(given foo: String)")
1720+
checkMessagesAfter(FrontEnd.name) ("case class Test(using foo: String)")
17341721
.expect {
17351722
(ictx, messages) =>
17361723
implicit val ctx: Context = ictx

docs/docs/reference/changed-features/numeric-literals.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ no code that can be executed at runtime. That's why we define an intermediary cl
201201
method in the `FromDigits` given instance. That method is defined in terms of a macro
202202
implementation method `fromDigitsImpl`. Here is its definition:
203203
```scala
204-
private def fromDigitsImpl(digits: Expr[String])(given ctx: QuoteContext): Expr[BigFloat] =
204+
private def fromDigitsImpl(digits: Expr[String])(using ctx: QuoteContext): Expr[BigFloat] =
205205
digits match {
206206
case Const(ds) =>
207207
try {

docs/docs/reference/contextual/derivation-macro.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ we need to implement a method `Eq.derived` on the companion object of `Eq` that
2525
produces a quoted instance for `Eq[T]`. Here is a possible signature,
2626

2727
```scala
28-
given derived[T: Type](given qctx: QuoteContext): Expr[Eq[T]]
28+
given derived[T: Type](using qctx: QuoteContext): Expr[Eq[T]]
2929
```
3030

3131
and for comparison reasons we give the same signature we had with `inline`:
@@ -41,10 +41,10 @@ from the signature. The body of the `derived` method is shown below:
4141

4242

4343
```scala
44-
given derived[T: Type](given qctx: QuoteContext): Expr[Eq[T]] = {
44+
given derived[T: Type](using qctx: QuoteContext): Expr[Eq[T]] = {
4545
import qctx.tasty.{_, given}
4646

47-
val ev: Expr[Mirror.Of[T]] = summonExpr(given '[Mirror.Of[T]]).get
47+
val ev: Expr[Mirror.Of[T]] = summonExpr(using '[Mirror.Of[T]]).get
4848

4949
ev match {
5050
case '{ $m: Mirror.ProductOf[T] { type MirroredElemTypes = $elementTypes }} =>
@@ -91,10 +91,10 @@ The implementation of `summonAll` as a macro can be show below assuming that we
9191
have the given instances for our primitive types:
9292

9393
```scala
94-
def summonAll[T](t: Type[T])(given qctx: QuoteContext): List[Expr[Eq[_]]] = t match {
94+
def summonAll[T](t: Type[T])(using qctx: QuoteContext): List[Expr[Eq[_]]] = t match {
9595
case '[String *: $tpes] => '{ summon[Eq[String]] } :: summonAll(tpes)
9696
case '[Int *: $tpes] => '{ summon[Eq[Int]] } :: summonAll(tpes)
97-
case '[$tpe *: $tpes] => derived(given tpe, qctx) :: summonAll(tpes)
97+
case '[$tpe *: $tpes] => derived(using tpe, qctx) :: summonAll(tpes)
9898
case '[Unit] => Nil
9999
}
100100
```
@@ -120,7 +120,7 @@ Alternatively and what is shown below is that we can call the `eqv` method
120120
directly. The `eqGen` can trigger the derivation.
121121

122122
```scala
123-
inline def [T](x: =>T) === (y: =>T)(given eq: Eq[T]): Boolean = eq.eqv(x, y)
123+
inline def [T](x: =>T) === (y: =>T)(using eq: Eq[T]): Boolean = eq.eqv(x, y)
124124

125125
implicit inline def eqGen[T]: Eq[T] = ${ Eq.derived[T] }
126126
```
@@ -168,17 +168,17 @@ object Eq {
168168
def eqv(x: T, y: T): Boolean = body(x, y)
169169
}
170170

171-
def summonAll[T](t: Type[T])(given qctx: QuoteContext): List[Expr[Eq[_]]] = t match {
171+
def summonAll[T](t: Type[T])(using qctx: QuoteContext): List[Expr[Eq[_]]] = t match {
172172
case '[String *: $tpes] => '{ summon[Eq[String]] } :: summonAll(tpes)
173173
case '[Int *: $tpes] => '{ summon[Eq[Int]] } :: summonAll(tpes)
174-
case '[$tpe *: $tpes] => derived(given tpe, qctx) :: summonAll(tpes)
174+
case '[$tpe *: $tpes] => derived(using tpe, qctx) :: summonAll(tpes)
175175
case '[Unit] => Nil
176176
}
177177

178-
given derived[T: Type](given qctx: QuoteContext): Expr[Eq[T]] = {
178+
given derived[T: Type](using qctx: QuoteContext): Expr[Eq[T]] = {
179179
import qctx.tasty.{_, given}
180180

181-
val ev: Expr[Mirror.Of[T]] = summonExpr(given '[Mirror.Of[T]]).get
181+
val ev: Expr[Mirror.Of[T]] = summonExpr(using '[Mirror.Of[T]]).get
182182

183183
ev match {
184184
case '{ $m: Mirror.ProductOf[T] { type MirroredElemTypes = $elementTypes }} =>
@@ -216,7 +216,7 @@ object Eq {
216216
}
217217

218218
object Macro3 {
219-
inline def [T](x: =>T) === (y: =>T)(given eq: Eq[T]): Boolean = eq.eqv(x, y)
219+
inline def [T](x: =>T) === (y: =>T)(using eq: Eq[T]): Boolean = eq.eqv(x, y)
220220

221221
implicit inline def eqGen[T]: Eq[T] = ${ Eq.derived[T] }
222222
}

docs/docs/reference/metaprogramming/macros.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -713,7 +713,7 @@ private def showMeExpr(sc: Expr[StringContext], argsExpr: Expr[Seq[Any]])(using
713713
val argShowedExprs = argExprs.map {
714714
case '{ $arg: $tp } =>
715715
val showTp = '[Show[$tp]]
716-
summonExpr(given showTp)) match {
716+
summonExpr(using showTp)) match {
717717
case Some(showExpr) => '{ $showExpr.show($arg) }
718718
case None => qctx.error(s"could not find implicit for ${showTp.show}", arg); '{???}
719719
}

docs/docs/reference/other-new-features/quoted-pattern-spec.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,14 @@ def notMatched = None
4747
def matched = Some(()) // aka Some(Tuple0())
4848
def matched[T](x: T) = Some(Tuple1(x))
4949
def (x: Matching) && (y: Matching) = if (x == None || y == None) None else Some(x.get ++ y.get)
50-
def fold[T](m: Mattching*)(given Env): Matching = m.fold(matched)(_ && _)
50+
def fold[T](m: Mattching*)(using Env): Matching = m.fold(matched)(_ && _)
5151

5252
// `a =#= b` stands for `a` matches `b`
53-
def (scrutinee: Tree) =#= pattern: Tree)(given Env): Matching // described by cases in the tables below
53+
def (scrutinee: Tree) =#= pattern: Tree)(using Env): Matching // described by cases in the tables below
5454

55-
def envWith(equiv: (Symbol, Symbol)*)(given Env): Env // Adds to the current environment the fact that s1 from the scrutinee is equivalent to s2 in the pattern
55+
def envWith(equiv: (Symbol, Symbol)*)(using Env): Env // Adds to the current environment the fact that s1 from the scrutinee is equivalent to s2 in the pattern
5656

57-
def equivalent(s1: Symbol, s2: Symbol)(given Env): Env
57+
def equivalent(s1: Symbol, s2: Symbol)(using Env): Env
5858
```
5959

6060
The implementation of `=#=`

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()(using 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(using positions)}
256256
|
257257
""".stripMargin
258258
val assertionError = new AssertionError(msg + ex.getMessage)

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,5 +24,5 @@ class PositionContext(positionMap: Map[CodeMarker, (TestFile, Int, Int)]) {
2424
}
2525

2626
object PositionContext {
27-
type PosCtx[T] = (given PositionContext) => T
27+
type PosCtx[T] = PositionContext ?=> T
2828
}

language-server/test/dotty/tools/languageserver/util/actions/Action.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import PositionContext._
1111
* definition, etc.)
1212
*/
1313
trait Action {
14-
type Exec[T] = (given TestServer, TestClient, PositionContext) => T
14+
type Exec[T] = (TestServer, TestClient, PositionContext) ?=> T
1515

1616
/** Execute the action. */
1717
def execute(): Exec[Unit]

sbt-dotty/sbt-test/sbt-dotty/quoted-example-project/src/main/scala/hello/Hello.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ object Main {
4141
code
4242
}
4343

44-
def powerCode(n: Int, x: Expr[Double])(given QuoteContext): Expr[Double] =
44+
def powerCode(n: Int, x: Expr[Double])(using QuoteContext): Expr[Double] =
4545
if (n == 0) '{1.0}
4646
else if (n == 1) x
4747
else if (n < 0) throw new Exception("Negative powers not implemented. Left as a small exercise. Dont be shy, try it out.")

sbt-dotty/sbt-test/source-dependencies/macro-expansion-dependencies-1/changes/Macro.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ object Macro {
44

55
inline def f(): Unit = ${ macroImplementation }
66

7-
def macroImplementation(given QuoteContext): Expr[Unit] = {
7+
def macroImplementation(using QuoteContext): Expr[Unit] = {
88
'{ println("Implementation in Macro") }
99
}
1010

sbt-dotty/sbt-test/source-dependencies/macro-expansion-dependencies-1/changes/MacroCompileError.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ object Macro {
44

55
inline def f(): Unit = ${ macroImplementation }
66

7-
def macroImplementation(given qctx: QuoteContext): Expr[Unit] = {
7+
def macroImplementation(using qctx: QuoteContext): Expr[Unit] = {
88
import qctx.tasty._
99
error("some error", rootPosition)
1010
'{ println("Implementation in MacroCompileError") }

0 commit comments

Comments
 (0)