From e986a97587a4f3493d614ac8d29adb54c564d146 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Chantepie?= Date: Sat, 23 Oct 2021 23:48:34 +0200 Subject: [PATCH] Symbol type --- compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala | 1 + library/src/scala/quoted/Quotes.scala | 3 +++ 2 files changed, 4 insertions(+) diff --git a/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala b/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala index 8a8e34901a3b..e9aeb719c83d 100644 --- a/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala +++ b/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala @@ -2480,6 +2480,7 @@ class QuotesImpl private (using val ctx: Context) extends Quotes, QuoteUnpickler def name: String = self.denot.name.toString def fullName: String = self.denot.fullName.toString + def tpe: TypeRepr = self.denot.info def pos: Option[Position] = if self.exists then Some(self.sourcePos) else None diff --git a/library/src/scala/quoted/Quotes.scala b/library/src/scala/quoted/Quotes.scala index 397f9d3b6aae..7b9f27f8c7bf 100644 --- a/library/src/scala/quoted/Quotes.scala +++ b/library/src/scala/quoted/Quotes.scala @@ -3585,6 +3585,9 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching => /** The full name of this symbol up to the root package */ def fullName: String + /** The type of this symbol */ + def tpe: TypeRepr + /** The position of this symbol */ def pos: Option[Position]