summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authorPaul Phillips <paulp@improving.org>2011-09-09 00:14:27 +0000
committerPaul Phillips <paulp@improving.org>2011-09-09 00:14:27 +0000
commit65a785e17793e39a67a26ad30abe0a02edc5bf89 (patch)
treec0df82365b2f4d188cd9ee5ee9a4eb18c18f5646 /src/compiler
parent2c5f1e8b027ef3ed360e5c73f14c3833a40b8d09 (diff)
downloadscala-65a785e17793e39a67a26ad30abe0a02edc5bf89.tar.gz
scala-65a785e17793e39a67a26ad30abe0a02edc5bf89.tar.bz2
scala-65a785e17793e39a67a26ad30abe0a02edc5bf89.zip
Added parens to many methods.
scalac -Xlint said: warning: side-effecting nullary methods are discouraged: suggest defining as `def initErrorCheck()` instead x 56. Plus a couple other linty things. No review.
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/reflect/runtime/RuntimeTypes.scala2
-rw-r--r--src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala2
-rw-r--r--src/compiler/scala/tools/nsc/ast/Trees.scala10
-rw-r--r--src/compiler/scala/tools/nsc/interpreter/JLineReader.scala2
-rw-r--r--src/compiler/scala/tools/nsc/interpreter/Power.scala4
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/ErrorTrees.scala2
6 files changed, 11 insertions, 11 deletions
diff --git a/src/compiler/scala/reflect/runtime/RuntimeTypes.scala b/src/compiler/scala/reflect/runtime/RuntimeTypes.scala
index 497290dbbc..00b1a028fd 100644
--- a/src/compiler/scala/reflect/runtime/RuntimeTypes.scala
+++ b/src/compiler/scala/reflect/runtime/RuntimeTypes.scala
@@ -11,7 +11,7 @@ trait RuntimeTypes extends Universe with api.RuntimeTypes {
// case class Literal(x: Any),
// once calls to the deprecated factory Literal(x: Any) has been eliminated from all code.
case class FreeValue(any: Any) extends Tree {
- protected def initErrorCheck {
+ protected def initErrorCheck() {
hasErrorTree = Some(false)
}
}
diff --git a/src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala b/src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala
index 37dea497fc..47715e5e68 100644
--- a/src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala
+++ b/src/compiler/scala/tools/nsc/ast/TreeBrowsers.scala
@@ -37,7 +37,7 @@ abstract class TreeBrowsers {
def create(): SwingBrowser = new SwingBrowser();
trait ValidTree extends Tree {
- protected def initErrorCheck {
+ protected def initErrorCheck() {
hasErrorTree = Some(false)
}
}
diff --git a/src/compiler/scala/tools/nsc/ast/Trees.scala b/src/compiler/scala/tools/nsc/ast/Trees.scala
index db5848f92b..cb1d5dd274 100644
--- a/src/compiler/scala/tools/nsc/ast/Trees.scala
+++ b/src/compiler/scala/tools/nsc/ast/Trees.scala
@@ -19,7 +19,7 @@ trait Trees extends reflect.internal.Trees { self: Global =>
// --- additional cases --------------------------------------------------------
/** Only used during parsing */
case class Parens(args: List[Tree]) extends Tree {
- protected def initErrorCheck {
+ protected def initErrorCheck() {
hasErrorTree = containsErrorCheck(args)
}
}
@@ -33,7 +33,7 @@ trait Trees extends reflect.internal.Trees { self: Global =>
override def isTerm = definition.isTerm
override def isType = definition.isType
- protected def initErrorCheck {
+ protected def initErrorCheck() {
hasErrorTree = containsErrorCheck(definition)
}
}
@@ -44,7 +44,7 @@ trait Trees extends reflect.internal.Trees { self: Global =>
*/
case class AssignOrNamedArg(lhs: Tree, rhs: Tree)
extends TermTree {
- protected def initErrorCheck {
+ protected def initErrorCheck() {
hasErrorTree = containsErrorCheck(List(lhs, rhs))
}
}
@@ -52,14 +52,14 @@ trait Trees extends reflect.internal.Trees { self: Global =>
/** Array selection <qualifier> . <name> only used during erasure */
case class SelectFromArray(qualifier: Tree, name: Name, erasure: Type)
extends TermTree with RefTree {
- protected def initErrorCheck {
+ protected def initErrorCheck() {
hasErrorTree = containsErrorCheck(qualifier)
}
}
/** emitted by typer, eliminated by refchecks */
case class TypeTreeWithDeferredRefCheck()(val check: () => Either[AbsErrorTree, TypeTree]) extends TypTree {
- protected def initErrorCheck {
+ protected def initErrorCheck() {
hasErrorTree = Some(false)
}
}
diff --git a/src/compiler/scala/tools/nsc/interpreter/JLineReader.scala b/src/compiler/scala/tools/nsc/interpreter/JLineReader.scala
index 2e3dc506c6..99f6b627eb 100644
--- a/src/compiler/scala/tools/nsc/interpreter/JLineReader.scala
+++ b/src/compiler/scala/tools/nsc/interpreter/JLineReader.scala
@@ -54,7 +54,7 @@ class JLineReader(_completion: => Completion) extends InteractiveReader {
// A hook for running code after the repl is done initializing.
lazy val postInit: Unit = {
this setBellEnabled false
- if (history ne NoHistory)
+ if ((history: History) ne NoHistory)
this setHistory history
if (completion ne NoCompletion) {
diff --git a/src/compiler/scala/tools/nsc/interpreter/Power.scala b/src/compiler/scala/tools/nsc/interpreter/Power.scala
index 477803ed5b..7887fb8d84 100644
--- a/src/compiler/scala/tools/nsc/interpreter/Power.scala
+++ b/src/compiler/scala/tools/nsc/interpreter/Power.scala
@@ -318,7 +318,7 @@ abstract class Power(
class RichReplString(s: String) {
// pretty print the string
- def pp { intp.prettyPrint(s) }
+ def pp() { intp.prettyPrint(s) }
// make an url out of the string
def u: URL = (
if (s contains ":") new URL(s)
@@ -333,7 +333,7 @@ abstract class Power(
}
class RichReplURL(url: URL)(implicit codec: Codec) {
def slurp(): String = io.Streamable.slurp(url)
- def pp { intp prettyPrint slurp() }
+ def pp() { intp prettyPrint slurp() }
}
protected trait Implicits1 {
diff --git a/src/compiler/scala/tools/nsc/typechecker/ErrorTrees.scala b/src/compiler/scala/tools/nsc/typechecker/ErrorTrees.scala
index 714c4384ce..a7fecf1373 100644
--- a/src/compiler/scala/tools/nsc/typechecker/ErrorTrees.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/ErrorTrees.scala
@@ -10,7 +10,7 @@ trait ErrorTrees {
def emit(context: Context): Unit
def emit(): Unit = emit(typer.context.asInstanceOf[Context])
- protected def initErrorCheck {
+ protected def initErrorCheck() {
hasErrorTree = Some(true)
}
def exception: TypeError = null // Once we get rid of all thrown type errors (apart from cyclic), remove