From dbdce5191a25627e6921bce26f697b45554334f5 Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Wed, 11 Mar 2020 13:08:02 +0100 Subject: [PATCH] Remove unnecessary imports part 2 --- library/src/scala/quoted/QuoteContext.scala | 20 ++++++------------- .../tasty/reflect/ExtractorsPrinter.scala | 2 +- .../tasty/reflect/SourceCodePrinter.scala | 2 +- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/library/src/scala/quoted/QuoteContext.scala b/library/src/scala/quoted/QuoteContext.scala index 5545c7e2c783..347ad6fb3860 100644 --- a/library/src/scala/quoted/QuoteContext.scala +++ b/library/src/scala/quoted/QuoteContext.scala @@ -30,16 +30,12 @@ class QuoteContext(val tasty: scala.tasty.Reflection) { self => } /** Report an error at the position of the macro expansion */ - def error(msg: => String): Unit = { - import tasty.{_, given _} - tasty.error(msg, rootPosition) - } + def error(msg: => String): Unit = + tasty.error(msg, tasty.rootPosition) /** Report an error at the on the position of `expr` */ - def error(msg: => String, expr: Expr[Any]): Unit = { - import tasty.{_, given _} + def error(msg: => String, expr: Expr[Any]): Unit = tasty.error(msg, expr.unseal(using this).pos) - } /** Report an error at the position of the macro expansion and throws a StopQuotedContext */ def throwError(msg: => String): Nothing = { @@ -53,15 +49,11 @@ class QuoteContext(val tasty: scala.tasty.Reflection) { self => } /** Report a warning */ - def warning(msg: => String): Unit = { - import tasty.{_, given _} - tasty.warning(msg, rootPosition) - } + def warning(msg: => String): Unit = + tasty.warning(msg, tasty.rootPosition) /** Report a warning at the on the position of `expr` */ - def warning(msg: => String, expr: Expr[_]): Unit = { - import tasty.{_, given _} + def warning(msg: => String, expr: Expr[_]): Unit = tasty.warning(msg, expr.unseal(using this).pos) - } } diff --git a/library/src/scala/tasty/reflect/ExtractorsPrinter.scala b/library/src/scala/tasty/reflect/ExtractorsPrinter.scala index 0b2c1c49f715..f33165ea0e6d 100644 --- a/library/src/scala/tasty/reflect/ExtractorsPrinter.scala +++ b/library/src/scala/tasty/reflect/ExtractorsPrinter.scala @@ -2,7 +2,7 @@ package scala.tasty package reflect class ExtractorsPrinter[R <: Reflection & Singleton](val tasty: R) extends Printer[R] { - import tasty.{_, given _} + import tasty._ def showTree(tree: Tree)(using ctx: Context): String = new Buffer().visitTree(tree).result() diff --git a/library/src/scala/tasty/reflect/SourceCodePrinter.scala b/library/src/scala/tasty/reflect/SourceCodePrinter.scala index 4736ed5fa0df..4f331338dce7 100644 --- a/library/src/scala/tasty/reflect/SourceCodePrinter.scala +++ b/library/src/scala/tasty/reflect/SourceCodePrinter.scala @@ -6,7 +6,7 @@ import scala.quoted.show.SyntaxHighlight /** Printer for fully elaborated representation of the source code */ class SourceCodePrinter[R <: Reflection & Singleton](val tasty: R)(syntaxHighlight: SyntaxHighlight) extends Printer[R] { - import tasty.{_, given _} + import tasty._ import syntaxHighlight._ def showTree(tree: Tree)(using ctx: Context): String =