Skip to content

Commit a205c40

Browse files
nicolasstuckicheeseng
authored andcommitted
Drop tasty reflect given imports
1 parent 7a2b9eb commit a205c40

File tree

18 files changed

+49
-49
lines changed

18 files changed

+49
-49
lines changed

common-test.dotty/src/main/scala/org/scalatest/LineNumberHelper.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ private[scalatest] trait LineNumberHelper {
99

1010
object LineNumberMacro {
1111
def thisLineNumberImpl(implicit qctx: QuoteContext): Expr[Int] = {
12-
import qctx.tasty.{_, given _}
12+
import qctx.tasty._
1313
Expr(rootPosition.startLine)
1414
}
1515
}

project/GenAnyVals.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ object GenAnyVals {
3232
| def apply(value: Expr[$primitiveTypeName])(implicit qctx: QuoteContext): Expr[$typeName] = {
3333
| val notValidMsg = Resources.notValid$typeName
3434
| val notLiteralMsg = Resources.notLiteral$typeName
35-
| import qctx.tasty.{_, given _}
35+
| import qctx.tasty._
3636
| ensureValid${primitiveTypeName}Literal(value, notValidMsg, notLiteralMsg)(isValid)
3737
| '{ $typeName.ensuringValid($$value) }
3838
| }

scalactic.dotty/src/main/scala/org/scalactic/BooleanMacro.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ object BooleanMacro {
3838
"exists") ++ logicOperators
3939

4040
def parse(condition: Expr[Boolean], prettifier: Expr[Prettifier])(implicit qctx: QuoteContext): Expr[Bool] = {
41-
import qctx.tasty.{_, given _}
41+
import qctx.tasty._
4242
import util._
4343

4444
def exprStr: String = condition.show

scalactic.dotty/src/main/scala/org/scalactic/Requirements.scala

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ object RequirementsMacro {
231231
* @return transformed expression that performs the requirement check and throw <code>IllegalArgumentException</code> with rich error message if requirement failed
232232
*/
233233
def require(condition: Expr[Boolean], prettifier: Expr[Prettifier], clue: Expr[Any])(implicit qctx: QuoteContext): Expr[Unit] = {
234-
import qctx.tasty.{_, given _}
234+
import qctx.tasty._
235235

236236
val bool = BooleanMacro.parse(condition, prettifier)
237237
'{ Requirements.requirementsHelper.macroRequire($bool, $clue) }
@@ -245,7 +245,7 @@ object RequirementsMacro {
245245
* @return transformed expression that performs the requirement check and throw <code>IllegalStateException</code> with rich error message if requirement failed
246246
*/
247247
def requireState(condition: Expr[Boolean], prettifier: Expr[Prettifier], clue: Expr[Any])(implicit qctx: QuoteContext): Expr[Unit] = {
248-
import qctx.tasty.{_, given _}
248+
import qctx.tasty._
249249

250250
val bool = BooleanMacro.parse(condition, prettifier)
251251
'{ Requirements.requirementsHelper.macroRequireState($bool, $clue) }
@@ -259,7 +259,7 @@ object RequirementsMacro {
259259
* @return transformed expression that performs the requirement check and throw <code>NullArgumentException</code> with rich error message if requirement failed
260260
*/
261261
def requireNonNull(arguments: Expr[Seq[Any]], prettifier: Expr[Prettifier], pos: Expr[source.Position])(implicit qctx: QuoteContext): Expr[Unit] = {
262-
import qctx.tasty.{_, given _}
262+
import qctx.tasty._
263263

264264
def liftSeq(args: Seq[Expr[String]]): Expr[Seq[String]] = args match {
265265
case x :: xs => '{ ($x) +: ${ liftSeq(xs) } }

scalactic.dotty/src/main/scala/org/scalactic/Snapshots.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ object Snapshots extends Snapshots
221221
object SnapshotsMacro {
222222

223223
def snap(expressions: Expr[Seq[Any]])(implicit qctx: QuoteContext): Expr[SnapshotSeq] = {
224-
import qctx.tasty.{_, given _}
224+
import qctx.tasty._
225225

226226
def liftSeq(args: Seq[Expr[Snapshot]]): Expr[Seq[Snapshot]] = args match {
227227
case x :: xs => '{ ($x) +: ${ liftSeq(xs) } }

scalactic.dotty/src/main/scala/org/scalactic/anyvals/CompileTimeAssertions.scala

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ trait CompileTimeAssertions {
201201
* @param isValid a function used to validate a literal value parsed from the given expression
202202
*/
203203
def ensureValidIntLiteral(value: Expr[Int], notValidMsg: String, notLiteralMsg: String)(isValid: Int => Boolean)(implicit qctx: QuoteContext): Unit = {
204-
import qctx.tasty.{_, given _}
204+
import qctx.tasty._
205205

206206
value.unseal.underlyingArgument match {
207207
case Literal(intConst) =>
@@ -236,7 +236,7 @@ trait CompileTimeAssertions {
236236
* @param isValid a function used to validate a literal value parsed from the given expression
237237
*/
238238
def ensureValidLongLiteral(value: Expr[Long], notValidMsg: String, notLiteralMsg: String)(isValid: Long => Boolean)(implicit qctx: QuoteContext): Unit = {
239-
import qctx.tasty.{_, given _}
239+
import qctx.tasty._
240240

241241
value.unseal.underlyingArgument match {
242242
case Literal(longConst) =>
@@ -271,7 +271,7 @@ trait CompileTimeAssertions {
271271
* @param isValid a function used to validate a literal value parsed from the given expression
272272
*/
273273
def ensureValidFloatLiteral(value: Expr[Float], notValidMsg: String, notLiteralMsg: String)(isValid: Float => Boolean)(implicit qctx: QuoteContext): Unit = {
274-
import qctx.tasty.{_, given _}
274+
import qctx.tasty._
275275

276276
value.unseal.underlyingArgument match {
277277
case Literal(floatConst) =>
@@ -306,7 +306,7 @@ trait CompileTimeAssertions {
306306
* @param isValid a function used to validate a literal value parsed from the given expression
307307
*/
308308
def ensureValidDoubleLiteral(value: Expr[Double], notValidMsg: String, notLiteralMsg: String)(isValid: Double => Boolean)(implicit qctx: QuoteContext): Unit = {
309-
import qctx.tasty.{_, given _}
309+
import qctx.tasty._
310310

311311
value.unseal.underlyingArgument match {
312312
case Literal(doubleConst) =>
@@ -341,7 +341,7 @@ trait CompileTimeAssertions {
341341
* @param isValid a function used to validate a literal value parsed from the given expression
342342
*/
343343
def ensureValidStringLiteral(value: Expr[String], notValidMsg: String, notLiteralMsg: String)(isValid: String => Boolean)(implicit qctx: QuoteContext): Unit = {
344-
import qctx.tasty.{_, given _}
344+
import qctx.tasty._
345345

346346
value.unseal.underlyingArgument match {
347347
case Literal(stringConst) =>
@@ -376,7 +376,7 @@ trait CompileTimeAssertions {
376376
* @param isValid a function used to validate a literal value parsed from the given expression
377377
*/
378378
def ensureValidCharLiteral(value: Expr[Char], notValidMsg: String, notLiteralMsg: String)(isValid: Char => Boolean)(implicit qctx: QuoteContext): Unit = {
379-
import qctx.tasty.{_, given _}
379+
import qctx.tasty._
380380

381381
value.unseal.underlyingArgument match {
382382
case Literal(charConst) =>

scalactic.dotty/src/main/scala/org/scalactic/anyvals/NumericStringMacro.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ object NumericStringMacro {
2525
def isValid(s: String): Boolean = s.forall(c => c >= '0' && c <= '9')
2626

2727
def apply(value: Expr[String])(implicit qctx: QuoteContext): Expr[NumericString] = {
28-
import qctx.tasty.{_, given _}
28+
import qctx.tasty._
2929

3030
val notValidMsg =
3131
"NumericString.apply can only be invoked on String literals that contain numeric characters, i.e., decimal digits '0' through '9', " +

scalactic.dotty/src/main/scala/org/scalactic/anyvals/PercentageIntMacros.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ object PercentageIntMacro {
2424
def isValid(i: Int): Boolean = i >= 0 && i <= 100
2525

2626
def apply(value: Expr[Int])(implicit qctx: QuoteContext): Expr[PercentageInt] = {
27-
import qctx.tasty.{_, given _}
27+
import qctx.tasty._
2828

2929
val notValidMsg =
3030
"PercentageInt.apply can only be invoked on Int literals between 0 and 100, "+

scalactic.dotty/src/main/scala/org/scalactic/anyvals/RegexStringMacro.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ object RegexStringMacro {
4343
}
4444

4545
def apply(value: Expr[String])(implicit qctx: QuoteContext): Expr[RegexString] = {
46-
import qctx.tasty.{_, given _}
46+
import qctx.tasty._
4747

4848
val notValidExceptionMsg: String = {
4949
value.unseal match {

scalactic.dotty/src/main/scala/org/scalactic/source/Position.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ object Position {
6767
* Helper method for Position macro.
6868
*/
6969
private def genPosition(implicit qctx: QuoteContext): Expr[Position] = {
70-
import qctx.tasty.{_, given _}
70+
import qctx.tasty._
7171

7272
val file = rootPosition.sourceFile
7373
val fileName: String = file.jpath.getFileName.toString

0 commit comments

Comments
 (0)