Skip to content

Commit

Permalink
Remove trailing whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolasstucki committed Apr 4, 2023
1 parent b0ad1e1 commit e1ab97e
Show file tree
Hide file tree
Showing 31 changed files with 59 additions and 59 deletions.
6 changes: 3 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE/fix-issue.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ assignees: ''

---

<!--
TODO first sign the CLA
<!--
TODO first sign the CLA
https://www.lightbend.com/contribute/cla/scala
-->

## Fix #XYZ

<!-- TODO description of the change -->
<!-- TODO description of the change -->


<!-- Ideally should have a called "Fix #XYZ: A SHORT FIX DESCRIPTION" -->
6 changes: 3 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE/other-pr.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@ assignees: ''

---

<!--
TODO first sign the CLA
<!--
TODO first sign the CLA
https://www.lightbend.com/contribute/cla/scala
-->

## Description

<!-- TODO description of the change -->
<!-- TODO description of the change -->


<!-- Ideally should have a single commit -->
4 changes: 2 additions & 2 deletions .github/workflows/releases.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,9 @@ jobs:
options: --cpu-shares 4096

env:
SDKMAN_KEY: ${{ secrets.SDKMAN_KEY }}
SDKMAN_KEY: ${{ secrets.SDKMAN_KEY }}
SDKMAN_TOKEN: ${{ secrets.SDKMAN_TOKEN }}

steps:
- name: Reset existing repo
run: git -c "http.https://github.com/.extraheader=" fetch --recurse-submodules=no "https://github.com/lampepfl/dotty" && git reset --hard FETCH_HEAD || true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/scripts/publish-sdkman.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,11 @@

set -u

# latest stable dotty version
# latest stable dotty version
DOTTY_VERSION=$(curl -s https://api.github.com/repos/lampepfl/dotty/releases/latest | grep '"tag_name":' | sed -E 's/.*"([^"]+)".*/\1/')
DOTTY_URL="https://github.com/lampepfl/dotty/releases/download/$DOTTY_VERSION/scala3-$DOTTY_VERSION.zip"

# checking if dotty version is available
# checking if dotty version is available
if ! curl --output /dev/null --silent --head --fail "$DOTTY_URL"; then
echo "URL doesn't exist: $DOTTY_URL"
exit 1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class InitializedAccess {

@Setup
def prepare: Unit = {
holder = new LazyHolder
holder = new LazyHolder
holder.value
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class InitializedAccessAny {

@Setup
def prepare: Unit = {
holder = new LazyAnyHolder
holder = new LazyAnyHolder
holder.value
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class InitializedAccessGeneric {

@Setup
def prepare: Unit = {
holder = new LazyGenericHolder[String]("foo")
holder = new LazyGenericHolder[String]("foo")
holder.value
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class InitializedAccessString {

@Setup
def prepare: Unit = {
holder = new LazyStringHolder
holder = new LazyStringHolder
holder.value
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ object LazyVals {
}
}
}

class LazyHolder {

lazy val value: List[Int] = {
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/Compiler.scala
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ class Compiler {
new ExplicitOuter, // Add accessors to outer classes from nested ones.
new ExplicitSelf, // Make references to non-trivial self types explicit as casts
new StringInterpolatorOpt, // Optimizes raw and s and f string interpolators by rewriting them to string concatenations or formats
new DropBreaks) :: // Optimize local Break throws by rewriting them
new DropBreaks) :: // Optimize local Break throws by rewriting them
List(new PruneErasedDefs, // Drop erased definitions from scopes and simplify erased expressions
new UninitializedDefs, // Replaces `compiletime.uninitialized` by `_`
new InlinePatterns, // Remove placeholders of inlined patterns
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/dotc/cc/Setup.scala
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ extends tpd.TreeTraverser:
// hard-coded expansion since $throws aliases in stdlib are defined with `?=>` rather than `?->`
defn.FunctionOf(
AnnotatedType(
defn.CanThrowClass.typeRef.appliedTo(exc),
defn.CanThrowClass.typeRef.appliedTo(exc),
Annotation(defn.ErasedParamAnnot, defn.CanThrowClass.span)) :: Nil,
res,
isContextual = true
Expand Down
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/dotc/core/Annotations.scala
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ object Annotations {
object Annotation {

def apply(tree: Tree): ConcreteAnnotation = ConcreteAnnotation(tree)

def apply(cls: ClassSymbol, span: Span)(using Context): Annotation =
apply(cls, Nil, span)

Expand All @@ -206,7 +206,7 @@ object Annotations {

def apply(atp: Type, arg: Tree, span: Span)(using Context): Annotation =
apply(atp, arg :: Nil, span)

def apply(atp: Type, args: List[Tree], span: Span)(using Context): Annotation =
apply(New(atp, args).withSpan(span))

Expand Down
16 changes: 8 additions & 8 deletions compiler/src/dotty/tools/dotc/parsing/Parsers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -3129,8 +3129,8 @@ object Parsers {
/* -------- PARAMETERS ------------------------------------------- */

/** DefParamClauses ::= DefParamClause { DefParamClause } -- and two DefTypeParamClause cannot be adjacent
* DefParamClause ::= DefTypeParamClause
* | DefTermParamClause
* DefParamClause ::= DefTypeParamClause
* | DefTermParamClause
* | UsingParamClause
*/
def typeOrTermParamClauses(
Expand Down Expand Up @@ -3228,7 +3228,7 @@ object Parsers {
* UsingClsTermParamClause::= ‘(’ ‘using’ [‘erased’] (ClsParams | ContextTypes) ‘)’
* ClsParams ::= ClsParam {‘,’ ClsParam}
* ClsParam ::= {Annotation}
*
*
* TypelessClause ::= DefTermParamClause
* | UsingParamClause
*
Expand Down Expand Up @@ -3616,13 +3616,13 @@ object Parsers {
}
}



/** DefDef ::= DefSig [‘:’ Type] ‘=’ Expr
* | this TypelessClauses [DefImplicitClause] `=' ConstrExpr
* DefDcl ::= DefSig `:' Type
* DefSig ::= id [DefTypeParamClause] DefTermParamClauses
*
*
* if clauseInterleaving is enabled:
* DefSig ::= id [DefParamClauses] [DefImplicitClause]
*/
Expand Down Expand Up @@ -3661,8 +3661,8 @@ object Parsers {
val mods1 = addFlag(mods, Method)
val ident = termIdent()
var name = ident.name.asTermName
val paramss =
if in.featureEnabled(Feature.clauseInterleaving) then
val paramss =
if in.featureEnabled(Feature.clauseInterleaving) then
// If you are making interleaving stable manually, please refer to the PR introducing it instead, section "How to make non-experimental"
typeOrTermParamClauses(ParamOwner.Def, numLeadParams = numLeadParams)
else
Expand All @@ -3672,7 +3672,7 @@ object Parsers {
joinParams(tparams, vparamss)

var tpt = fromWithinReturnType { typedOpt() }

if (migrateTo3) newLineOptWhenFollowedBy(LBRACE)
val rhs =
if in.token == EQUALS then
Expand Down
4 changes: 2 additions & 2 deletions compiler/src/dotty/tools/dotc/transform/LazyVals.scala
Original file line number Diff line number Diff line change
Expand Up @@ -283,7 +283,7 @@ class LazyVals extends MiniPhase with IdentityDenotTransformer {
*
* ```
* private @volatile var _x: AnyRef = null
*
*
* def x: A =
* val result = _x
* if result.isInstanceOf[A] then
Expand All @@ -292,7 +292,7 @@ class LazyVals extends MiniPhase with IdentityDenotTransformer {
* null // possible unboxing applied here
* else
* x_compute() // possible unboxing applied here
*
*
* private def x_compute(): AnyRef =
* while <EmptyTree> do
* val current: AnyRef = _x
Expand Down
6 changes: 3 additions & 3 deletions compiler/src/dotty/tools/dotc/util/lrutest.sc
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ object lrutest {
cache.last //> res4: Int = 6
cache lookup "hi" //> res5: String = x
cache.indices.take(10).toList //> res6: List[Int] = List(7, 0, 1, 2, 3, 4, 5, 6, 7, 0)

for (i <- 1 to 10) {
if (cache.lookup(i.toString) == null)
cache.enter(i.toString, i.toString)
}

cache.indices.take(10).toList //> res7: List[Int] = List(5, 6, 7, 0, 1, 2, 3, 4, 5, 6)
cache //> res8: dotty.tools.dotc.util.LRUCache[String,String] = LRUCache(10 -> 10, 9 -
//| > 9, 8 -> 8, 7 -> 7, 6 -> 6, 5 -> 5, 4 -> 4, 3 -> 3)
Expand All @@ -35,6 +35,6 @@ object lrutest {
//| > 10, 7 -> 7, 9 -> 9, 8 -> 8, 6 -> 6, 4 -> 4, 3 -> 3)
cache.lookup("11") //> res16: String = null
cache.enter("11", "!!")
cache //> res17: dotty.tools.dotc.util.LRUCache[String,String] = LRUCache(11 -> !!, 5
cache //> res17: dotty.tools.dotc.util.LRUCache[String,String] = LRUCache(11 -> !!, 5
//| -> 5, 10 -> 10, 7 -> 7, 9 -> 9, 8 -> 8, 6 -> 6, 4 -> 4)
}
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/io/JDK9Reflectors.java
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public final class JDK9Reflectors {
}

// Classes from java.lang.Runtime are not available in JDK 8 so using them explicitly would prevent this file from compiling with JDK 8
// but these methods are not called in runtime when using this version of JDK
// but these methods are not called in runtime when using this version of JDK

public static /*java.lang.Runtime.Version*/ Object runtimeVersionParse(String string) {
try {
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/runner/ScalaClassLoader.scala
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ object ScalaClassLoader {
@sharable private[this] val bootClassLoader: ClassLoader =
if scala.util.Properties.isJavaAtLeast("9") then
try
ClassLoader.getSystemClassLoader.getParent
ClassLoader.getSystemClassLoader.getParent
catch case _: Throwable => null
else null

Expand Down
2 changes: 1 addition & 1 deletion compiler/test/worksheets/baseTypetest.sc
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@ object baseTypetest extends DottyTest {
defn.StringClass isSubClass defn.NullClass //> res4: Boolean = false
defn.StringClass.typeRef.baseType(defn.NullClass)
//> res5: dotty.tools.dotc.core.Types.Type = NoType

}
4 changes: 2 additions & 2 deletions compiler/test/worksheets/denotTest.sc
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import Types._, Symbols._

object denotTest extends DottyTest {
println("Welcome to the Scala worksheet") //> Welcome to the Scala worksheet

val str = defn.StringClass.typeRef //> str : dotty.tools.dotc.core.Types.TypeRef = TypeRef(ThisType(module class l
//| ang#57),String)
val d= str.member("getBytes".toTermName) //> d : dotty.tools.dotc.core.Denotations.Denotation = val getBytes <and> val g
Expand Down Expand Up @@ -47,7 +47,7 @@ object denotTest extends DottyTest {
//| a#35),Array), scala$Array$$T, TypeAlias(TypeRef(ThisType(module class scala#
//| 35),Char))), TypeRef(ThisType(module class scala#35),Int), TypeRef(ThisType(
//| module class scala#35),Int)), TypeRef(ThisType(module class lang#57),String)
//| ), JavaMethodType(List(x$0), List(RefinedType(TypeRef(ThisType(module class
//| ), JavaMethodType(List(x$0), List(RefinedType(TypeRef(ThisType(module class
//| scala#35),Array), scala$Array$$T, TypeAlias(TypeRef(ThisType(module class sc
//| ala#35),Char)))), TypeRef(ThisType(module class lang#57),String)), JavaMetho
//| dType(List(x$0), List(TypeRef(ThisType(module class scala#35),Any)), TypeRef
Expand Down
8 changes: 4 additions & 4 deletions compiler/test/worksheets/nesting.sc
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ package dotty.tools.dotc.core

object nesting {
class C {

class D {
private def x = "D"
def show = x
class E {
println(x)
}
}

val foo: D = {
class D extends C.this.D {
private def x = "foo.D"
Expand All @@ -21,11 +21,11 @@ object nesting {
new D
}
}

val c = new C //> c : dotty.tools.dotc.core.nesting.C = dotty.tools.dotc.core.nesting$C@1a84d
//| a23
val d = c.foo //> d : dotty.tools.dotc.core.nesting.c.D = dotty.tools.dotc.core.nesting$C$D$1
//| @2705d88a
d.show //> res0: String = foo.D

}
4 changes: 2 additions & 2 deletions compiler/test/worksheets/periodtest.sc
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ package dotty.tools.dotc.core

object periodtest {
println("Welcome to the Scala worksheet") //> Welcome to the Scala worksheet

import Periods._

val p1 = Period(1, 2, 7) //> p1 : dotty.tools.dotc.core.Periods.Period = Period(2..7, run = 1)
val p2 = Period(1, 3, 7) //> p2 : dotty.tools.dotc.core.Periods.Period = Period(3..7, run = 1)
p1 contains p2 //> res0: Boolean = true
Expand Down
2 changes: 1 addition & 1 deletion compiler/test/worksheets/positiontest.sc
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import Positions._

object positiontest {
println("Welcome to the Scala worksheet") //> Welcome to the Scala worksheet

val p = Position(0, 1, 0) //> p : dotty.tools.dotc.util.Positions.Position = [0..1]
val p2 = Position(0, 2) //> p2 : dotty.tools.dotc.util.Positions.Position = [0..2]
val p3 = Position(1, 0) //> p3 : dotty.tools.dotc.util.Positions.Position = [no position]
Expand Down
8 changes: 4 additions & 4 deletions compiler/test/worksheets/testnames.sc
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@ package dotty.tools.dotc.core

object testnames {
println("Welcome to the Scala worksheet") //> Welcome to the Scala worksheet

import Names._
val n = termName("hello") //> n : dotty.tools.dotc.core.Names.TermName = hello
val tn = n.toTypeName //> tn : dotty.tools.dotc.core.Names.TypeName = hello
val ln = n.toLocalName //> ln : dotty.tools.dotc.core.Names.LocalName = hello
assert(tn.toTermName eq n)
assert(tn.toLocalName eq ln)
assert(n.toLocalName eq ln)

n == tn //> res0: Boolean = false
n == ln //> res1: Boolean = false
n eq tn //> res2: Boolean = false
Expand All @@ -19,7 +19,7 @@ object testnames {
val foo = encodedTermName("++") //> foo : dotty.tools.dotc.core.Names.TermName = $plus$plus
foo.hashCode //> res5: Int = 5
foo.toTypeName.hashCode //> res6: Int = -5

val nfoo = n ++ foo //> nfoo : dotty.tools.dotc.core.testnames.n.ThisName = hello$plus$plus
nfoo contains '$' //> res7: Boolean = true
nfoo.replace('$', '.') //> res8: dotty.tools.dotc.core.testnames.nfoo.ThisName = hello.plus.plus
Expand All @@ -36,7 +36,7 @@ object testnames {
termName("abc") //> res18: dotty.tools.dotc.core.Names.TermName = abc
nfoo.filter(_ >= 'l') //> res19: dotty.tools.dotc.core.Names.Name = lloplusplus
nfoo map (_.toUpper) //> res20: dotty.tools.dotc.core.Names.Name = HELLO$PLUS$PLUS

import Decorators._

val local = "local".toTermName.toLocalName //> local : dotty.tools.dotc.core.Names.LocalName = local
Expand Down
2 changes: 1 addition & 1 deletion library/src/scala/runtime/LazyVals.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import scala.annotation.*
object LazyVals {
@nowarn
private[this] val unsafe: sun.misc.Unsafe = {
def throwInitializationException() =
def throwInitializationException() =
throw new ExceptionInInitializerError(
new IllegalStateException("Can't find instance of sun.misc.Unsafe")
)
Expand Down
2 changes: 1 addition & 1 deletion sbt-test/sbt-dotty/tasty-inspector-jars/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ lazy val inspector = project
.settings(
scalaVersion := dottyVersion,
libraryDependencies += "org.scala-lang" %% "scala3-tasty-inspector" % scalaVersion.value,
runTest :=
runTest :=
Def.sequential(
Def.task(IO.copyFile((lib/Compile/packageBin).value, jarDest)),
(Compile/run).toTask(" " + jarDest.getAbsolutePath)
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
object A
object A
Loading

0 comments on commit e1ab97e

Please sign in to comment.