Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/cc/CaptureSet.scala
Original file line number Diff line number Diff line change
Expand Up @@ -949,7 +949,7 @@ object CaptureSet:
* is not derived from some other variable.
*/
protected def ids(using Context): String =
def descr = getClass.getSimpleName.nn.take(1)
def descr = getClass.getSimpleName.take(1)
val trail = this.match
case dv: DerivedVar =>
def summary = if ctx.settings.YccVerbose.value then dv.summarize else descr
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/core/NullOpsDecorator.scala
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ object NullOpsDecorator:

/** Is self (after widening and dealiasing) a type of the form `T | Null`? */
def isNullableUnion(using Context): Boolean = {
val stripped = self.stripNull()
val stripped = self.stripNull(stripFlexibleTypes = false)
stripped ne self
}
end extension
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/core/SymbolLoaders.scala
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ object SymbolLoaders {
val fullName = pkg.name
val name =
if (packageName.isEmpty) fullName
else fullName.substring(packageName.length + 1).nn
else fullName.substring(packageName.length + 1)

enterPackage(root.symbol, name.toTermName,
(module, modcls) => new PackageLoader(module, classPath))
Expand Down
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/dotc/core/TypeComparer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3376,12 +3376,12 @@ object TypeComparer {
}

private[core] def show(res: Any)(using Context): String =
if ctx.settings.YexplainLowlevel.value then String.valueOf(res).nn
if ctx.settings.YexplainLowlevel.value then String.valueOf(res)
else res match
case ClassInfo(_, cls, _, _, _) => cls.showLocated
case bounds: TypeBounds => i"type bounds [$bounds]"
case res: printing.Showable => res.show
case _ => String.valueOf(res).nn
case _ => String.valueOf(res)

/** The approximation state indicates how the pair of types currently compared
* relates to the types compared originally.
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/core/Types.scala
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ object Types extends TypeUtils {
/** Is this type guaranteed not to have `null` as a value? */
final def isNotNull(using Context): Boolean = this match {
case tp: ConstantType => tp.value.value != null
case tp: FlexibleType => false
case tp: FlexibleType => true
case tp: ClassInfo => !tp.cls.isNullableClass && !tp.isNothingType
case tp: AppliedType => tp.superType.isNotNull
case tp: TypeBounds => tp.hi.isNotNull
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/typer/Typer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -1218,7 +1218,7 @@ class Typer(@constructorOnly nestingLevel: Int = 0) extends Namer
}
catch {
case ex: FromDigitsException =>
report.error(ex.getMessage.nn, tree.srcPos)
report.error(ex.getMessage, tree.srcPos)
tree.kind match {
case Whole(_) => lit(0)
case _ => lit(0.0)
Expand Down
4 changes: 2 additions & 2 deletions library/src/scala/reflect/Selectable.scala
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ trait Selectable extends scala.Selectable:
final def selectDynamic(name: String): Any =
val rcls = selectedValue.getClass
try
val fld = rcls.getField(NameTransformer.encode(name)).nn
val fld = rcls.getField(NameTransformer.encode(name))
ensureAccessible(fld)
fld.get(selectedValue)
catch case ex: NoSuchFieldException =>
Expand All @@ -37,7 +37,7 @@ trait Selectable extends scala.Selectable:
*/
final def applyDynamic(name: String, paramTypes: Class[?]*)(args: Any*): Any =
val rcls = selectedValue.getClass
val mth = rcls.getMethod(NameTransformer.encode(name), paramTypes*).nn
val mth = rcls.getMethod(NameTransformer.encode(name), paramTypes*)
ensureAccessible(mth)
mth.invoke(selectedValue, args.asInstanceOf[Seq[AnyRef]]*)

Expand Down
2 changes: 1 addition & 1 deletion library/src/scala/util/FromDigits.scala
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ object FromDigits {
case ex: NumberFormatException => throw MalformedNumber()
}
if (x.isInfinite) throw NumberTooLarge()
if (x == 0.0d && !zeroFloat.pattern.matcher(digits).nn.matches) throw NumberTooSmall()
if (x == 0.0d && !zeroFloat.pattern.matcher(digits).matches) throw NumberTooSmall()
x
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ object AutoImports:
def renameConfigMap(config: PresentationCompilerConfig)(using
Context
): Map[Symbol, String] =
config.symbolPrefixes().nn.asScala.flatMap { (from, to) =>
config.symbolPrefixes().asScala.flatMap { (from, to) =>
val pkg = SemanticdbSymbols.inverseSemanticdbSymbol(from)
val rename = to.stripSuffix(".").stripSuffix("#")
List(pkg, pkg.map(_.moduleClass)).flatten
Expand Down Expand Up @@ -253,7 +253,7 @@ object AutoImports:
// see WorksheetProvider.worksheetScala3AdjustmentsForPC
val indent =
if pos.source.path.isWorksheet &&
editPos.getStart().nn.getCharacter() == 0
editPos.getStart().getCharacter() == 0
then indent0.drop(2)
else indent0
val topPadding =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@ final class AutoImportsProvider(
)(using ReportContext):

def autoImports(isExtension: Boolean): List[AutoImportsResult] =
val uri = params.uri().nn
val text = params.text().nn
val uri = params.uri()
val text = params.text()
val filePath = Paths.get(uri)
driver.run(uri, SourceFile.virtual(filePath.toString, text))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class CompilerSearchVisitor(
)(using ctx: Context, reports: ReportContext)
extends SymbolSearchVisitor:

val logger: Logger = Logger.getLogger(classOf[CompilerSearchVisitor].getName()).nn
val logger: Logger = Logger.getLogger(classOf[CompilerSearchVisitor].getName())

private def isAccessibleImplicitClass(sym: Symbol) =
val owner = sym.maybeOwner
Expand Down Expand Up @@ -77,7 +77,7 @@ class CompilerSearchVisitor(
.split("\\$")

val added =
try toSymbols(pkg, innerPath.nn.toList.map(_.nn)).filter(visitSymbol)
try toSymbols(pkg, innerPath.toList).filter(visitSymbol)
catch
case NonFatal(e) =>
logger.log(Level.WARNING, e.getMessage(), e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ object CompletionItemResolver extends ItemResolver:
Context
): String =
def docs(gsym: Symbol): String =
search.symbolDocumentation(gsym).fold("")(_.docstring().nn)
search.symbolDocumentation(gsym).fold("")(_.docstring())
val gsymDoc = docs(gsym)
def keyword(gsym: Symbol): String =
if gsym.isClass then "class"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ final class ConvertToNamedArgumentsProvider(
):

def convertToNamedArguments: Either[String, List[l.TextEdit]] =
val uri = params.uri().nn
val text = params.text().nn
val uri = params.uri()
val text = params.text()
val filePath = Paths.get(uri)
driver.run(uri, SourceFile.virtual(filePath.toString, text))

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class DiagnosticProvider(driver: InteractiveDriver, params: VirtualFileParams):

def diagnostics(): List[lsp4j.Diagnostic] =
if params.shouldReturnDiagnostics then
val diags = driver.run(params.uri().nn, params.text().nn)
val diags = driver.run(params.uri(), params.text())
given Context = driver.currentCtx
diags.flatMap(toLsp)
else Nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ final class ExtractMethodProvider(
extends ExtractMethodUtils:

def extractMethod(): List[TextEdit] =
val text = range.text().nn
val uri = range.uri().nn
val text = range.text()
val uri = range.uri()
val filePath = Paths.get(uri)
val source = SourceFile.virtual(filePath.toString, text)
driver.run(uri, source)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ object HoverProvider:
search: SymbolSearch,
contentType: ContentType
)(implicit reportContext: ReportContext): ju.Optional[HoverSignature] =
val uri = params.uri().nn
val text = params.text().nn
val uri = params.uri()
val text = params.text()
val sourceFile = SourceFile.virtual(uri, text)
driver.run(uri, sourceFile)
val unit = driver.compilationUnits.get(uri)
Expand Down Expand Up @@ -90,7 +90,7 @@ object HoverProvider:
)
end report
reportContext.unsanitized.create(() => report, /*ifVerbose =*/ true)
ju.Optional.empty().nn
ju.Optional.empty()
else
val skipCheckOnName =
!pos.isPoint // don't check isHoveringOnName for RangeHover
Expand Down Expand Up @@ -158,9 +158,9 @@ object HoverProvider:
contextInfo = printer.getUsedRenamesInfo,
contentType = contentType
)
).nn
)
case _ =>
ju.Optional.empty().nn
ju.Optional.empty()
end match
case (_, tpe, Some(namedTupleArg)) :: _ =>
val exprTpw = tpe.widenTermRefExpr.deepDealiasAndSimplify
Expand All @@ -175,8 +175,8 @@ object HoverProvider:
contextInfo = printer.getUsedRenamesInfo,
contentType = contentType
)
).nn
case _ => ju.Optional.empty().nn
)
case _ => ju.Optional.empty()
end match
end if
end hover
Expand Down Expand Up @@ -238,7 +238,7 @@ object HoverProvider:

refTpe.flatMap(findRefinement).headOption.asJava
case _ =>
ju.Optional.empty().nn
ju.Optional.empty()

end HoverProvider

Expand Down
Loading
Loading