diff --git a/community-build/community-projects/scalatest b/community-build/community-projects/scalatest index 18111a2b67f5..b4031b59ee7b 160000 --- a/community-build/community-projects/scalatest +++ b/community-build/community-projects/scalatest @@ -1 +1 @@ -Subproject commit 18111a2b67f5626b7a9af5d4608655148d515c2f +Subproject commit b4031b59ee7b3d35a3db6aa386fa26be8692874f diff --git a/community-build/community-projects/utest b/community-build/community-projects/utest index c39c0575e543..f3333378b219 160000 --- a/community-build/community-projects/utest +++ b/community-build/community-projects/utest @@ -1 +1 @@ -Subproject commit c39c0575e543379e030a197dedf8cd7c73e52bc6 +Subproject commit f3333378b219fcccd7bd034fc6bee9f9cd367f72 diff --git a/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala b/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala index dd6ef0055cb7..f571154004b4 100644 --- a/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala +++ b/compiler/src/scala/quoted/runtime/impl/QuotesImpl.scala @@ -2291,7 +2291,8 @@ 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 pos: Position = self.sourcePos + def pos: Option[Position] = + if self.exists then Some(self.sourcePos) else None def documentation: Option[Documentation] = import dotc.core.Comments.CommentsContext @@ -2566,7 +2567,6 @@ class QuotesImpl private (using val ctx: Context) extends Quotes, QuoteUnpickler extension (self: Position): def start: Int = self.start def end: Int = self.end - def exists: Boolean = self.exists def sourceFile: SourceFile = self.source def startLine: Int = self.startLine def endLine: Int = self.endLine diff --git a/library/src/scala/quoted/Quotes.scala b/library/src/scala/quoted/Quotes.scala index 94852bf3223d..6e05698ba2af 100644 --- a/library/src/scala/quoted/Quotes.scala +++ b/library/src/scala/quoted/Quotes.scala @@ -3067,7 +3067,7 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching => def fullName: String /** The position of this symbol */ - def pos: Position + def pos: Option[Position] /** The documentation for this symbol, if any */ def documentation: Option[Documentation] @@ -3640,9 +3640,6 @@ trait Quotes { self: runtime.QuoteUnpickler & runtime.QuoteMatching => /** The end offset in the source file */ def end: Int - /** Does this position exist */ - def exists: Boolean - /** Source file in which this position is located */ def sourceFile: SourceFile diff --git a/scala3doc/src/dotty/dokka/tasty/BasicSupport.scala b/scala3doc/src/dotty/dokka/tasty/BasicSupport.scala index 5444e4dcd1e5..2d24b5a4885e 100644 --- a/scala3doc/src/dotty/dokka/tasty/BasicSupport.scala +++ b/scala3doc/src/dotty/dokka/tasty/BasicSupport.scala @@ -41,8 +41,8 @@ trait BasicSupport: Map.empty def source = - val path = Some(sym.pos.sourceFile.jpath).filter(_ != null).map(_.toAbsolutePath).map(_.toString) - path.map(TastyDocumentableSource(_, sym.pos.startLine)) + val path = Some(sym.pos.get.sourceFile.jpath).filter(_ != null).map(_.toAbsolutePath).map(_.toString) + path.map(TastyDocumentableSource(_, sym.pos.get.startLine)) def getAnnotations(): List[Annotation] = sym.annotations.filterNot(_.symbol.packageName.startsWith("scala.annotation.internal")).map(parseAnnotation).reverse diff --git a/scala3doc/src/dotty/dokka/tasty/ClassLikeSupport.scala b/scala3doc/src/dotty/dokka/tasty/ClassLikeSupport.scala index 037fd0138f9e..18f9afafa149 100644 --- a/scala3doc/src/dotty/dokka/tasty/ClassLikeSupport.scala +++ b/scala3doc/src/dotty/dokka/tasty/ClassLikeSupport.scala @@ -114,7 +114,7 @@ trait ClassLikeSupport: extSym.symbol.normalizedName, extSym.tpt.dokkaType.asSignature, extSym.tpt.symbol.dri, - extSym.symbol.pos.start + extSym.symbol.pos.get.start ) parseMethod(dd.symbol, kind = Kind.Extension(target)) } diff --git a/scala3doc/src/dotty/dokka/tasty/SyntheticSupport.scala b/scala3doc/src/dotty/dokka/tasty/SyntheticSupport.scala index a37dc87087d4..0924c62f54a0 100644 --- a/scala3doc/src/dotty/dokka/tasty/SyntheticSupport.scala +++ b/scala3doc/src/dotty/dokka/tasty/SyntheticSupport.scala @@ -41,7 +41,7 @@ trait SyntheticsSupport: c.flags.is(Flags.CaseAccessor) || (c.flags.is(Flags.Module) && !c.flags.is(Flags.Given)) def isValidPos(pos: Position) = - pos.exists && pos.start != pos.end + pos.start != pos.end def constructorWithoutParamLists(c: ClassDef): Boolean = !isValidPos(c.constructor.pos) || {