summaryrefslogtreecommitdiff
path: root/src/compiler
diff options
context:
space:
mode:
authormichelou <michelou@epfl.ch>2007-07-04 11:23:19 +0000
committermichelou <michelou@epfl.ch>2007-07-04 11:23:19 +0000
commit308f93f8ed160122118bdc3d0f81cc9a796f061f (patch)
treee2a008bac32067c422781a7cdc94fd3c7f734fc3 /src/compiler
parent1287e33524d8e83f7ad7c3974df0ec083f4799f2 (diff)
downloadscala-308f93f8ed160122118bdc3d0f81cc9a796f061f.tar.gz
scala-308f93f8ed160122118bdc3d0f81cc9a796f061f.tar.bz2
scala-308f93f8ed160122118bdc3d0f81cc9a796f061f.zip
renamed -checknull to -Xchecknull
Diffstat (limited to 'src/compiler')
-rw-r--r--src/compiler/scala/tools/nsc/Settings.scala8
-rw-r--r--src/compiler/scala/tools/nsc/ast/TreeGen.scala2
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/Typers.scala10
3 files changed, 10 insertions, 10 deletions
diff --git a/src/compiler/scala/tools/nsc/Settings.scala b/src/compiler/scala/tools/nsc/Settings.scala
index 9ed8a42a69..2967dd3a57 100644
--- a/src/compiler/scala/tools/nsc/Settings.scala
+++ b/src/compiler/scala/tools/nsc/Settings.scala
@@ -52,10 +52,10 @@ class Settings(error: String => Unit) {
val scalaHome = Properties.scalaHome
if (scalaHome ne null) {
val guessJar = new File(new File(new File(scalaHome), "lib"), "scala-library.jar")
- if (guessJar.exists()) guessJar.getPath()
+ if (guessJar.isFile()) guessJar.getPath()
else {
val guessDir = new File(new File(new File(scalaHome), "lib"), "library")
- if (guessDir.exists()) guessDir.getPath() else null
+ if (guessDir.isDirectory()) guessDir.getPath() else null
}
} else null
}
@@ -64,7 +64,7 @@ class Settings(error: String => Unit) {
val scalaHome = Properties.scalaHome
if (scalaHome ne null) {
val guess = new File(new File(scalaHome), "lib")
- if (guess.exists()) guess.getPath else null
+ if (guess.isDirectory()) guess.getPath else null
} else null
}
@@ -93,7 +93,6 @@ class Settings(error: String => Unit) {
val script = new StringSetting("-script", "object", "compile as a script, wrapping the code into object.main()", "") { override def hiddenToIDE = true }
val encoding = new StringSetting ("-encoding", "encoding", "Specify character encoding used by source files", encodingDefault) { override def hiddenToIDE = false }
val target = ChoiceSetting ("-target", "Specify which backend to use", List("jvm-1.5", "jvm-1.4", "msil", "cldc"), "jvm-1.4")
- val checknull = BooleanSetting("-checknull", "Emit warning on selection of nullable reference")
val migrate = BooleanSetting("-migrate", "Assist in migrating from Scala version 1.0")
val assemname = StringSetting ("-o", "file", "Name of the output assembly (only relevant with -target:msil)", "").dependsOn(target, "msil")
val assemrefs = StringSetting ("-r", "path", "List of assemblies referenced by the program (only relevant with -target:msil)", ".").dependsOn(target, "msil")
@@ -129,6 +128,7 @@ class Settings(error: String => Unit) {
/** non-standard options */
val Xhelp = new BooleanSetting("-X", "Print a synopsis of non-standard options") { override def hiddenToIDE = true }
val XO = BooleanSetting("-XO", "Optimize. implies -Xinline, -Xcloselim and -Xdce")
+ val Xchecknull = BooleanSetting("-Xchecknull", "Emit warning on selection of nullable reference")
val Xcloselim = BooleanSetting("-Xcloselim", "Perform closure elimination")
val Xcodebase = StringSetting ("-Xcodebase", "codebase", "Specify the URL containing the Scala libraries", "")
val Xdce = BooleanSetting("-Xdce", "Perform dead code elimination")
diff --git a/src/compiler/scala/tools/nsc/ast/TreeGen.scala b/src/compiler/scala/tools/nsc/ast/TreeGen.scala
index 4532980248..b08eee6e0f 100644
--- a/src/compiler/scala/tools/nsc/ast/TreeGen.scala
+++ b/src/compiler/scala/tools/nsc/ast/TreeGen.scala
@@ -159,7 +159,7 @@ abstract class TreeGen {
def mkCheckInit(tree: Tree): Tree = {
var tpe = tree.tpe
if (tpe == null && tree.hasSymbol) tpe = tree.symbol.tpe
- if (!global.phase.erasedTypes && settings.checknull.value &&
+ if (!global.phase.erasedTypes && settings.Xchecknull.value &&
tpe <:< NotNullClass.tpe && !tpe.isNotNull)
mkRuntimeCall(nme.checkInitialized, List(tree))
else
diff --git a/src/compiler/scala/tools/nsc/typechecker/Typers.scala b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
index f3ca3a5734..ac8c55e920 100644
--- a/src/compiler/scala/tools/nsc/typechecker/Typers.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/Typers.scala
@@ -52,12 +52,12 @@ trait Typers { self: Analyzer =>
super.traverse(tree)
}
}
- def makeNewScope(txt : Context, tree : Tree, sym : Symbol) =
+ def makeNewScope(txt: Context, tree: Tree, sym: Symbol) =
txt.makeNewScope(tree, sym)
- def newDecls(tree : CompoundTypeTree) = newScope
- def newDecls(tree : Template, clazz : Symbol) = newScope
- def newTemplateScope(impl : Template, clazz : Symbol) = newScope
+ def newDecls(tree: CompoundTypeTree) = newScope
+ def newDecls(tree: Template, clazz: Symbol) = newScope
+ def newTemplateScope(impl: Template, clazz: Symbol) = newScope
// Mode constants
@@ -2289,7 +2289,7 @@ trait Typers { self: Analyzer =>
}
val result = stabilize(checkAccessible(tree1, sym, qual.tpe, qual), qual.tpe, mode, pt)
if (sym.isCaseFactory && !phase.erasedTypes) checkStable(qual)
- if (!global.phase.erasedTypes && settings.checknull.value &&
+ if (!global.phase.erasedTypes && settings.Xchecknull.value &&
!sym.isConstructor &&
!(qual.tpe <:< NotNullClass.tpe) && !qual.tpe.isNotNull)
unit.warning(tree.pos, "potential null pointer dereference: "+tree)