diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000000..d9d8b125c878 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,26 @@ +# These files are text and should be normalized (convert crlf => lf) +*.c text +*.check text +*.css text +*.html text +*.java text +*.js text +*.sbt text +*.scala text +*.sh text +*.txt text +*.xml text + +# Windows-specific files get windows endings +*.bat eol=crlf +*.cmd eol=crlf +*-windows.tmpl eol=crlf + +# Some binary file types for completeness +# (binary is a macro for -text -diff) +*.dll binary +*.gif binary +*.jpg binary +*.png binary +*.class binary +*.jar binary \ No newline at end of file diff --git a/build.sbt b/build.sbt new file mode 100644 index 000000000000..8e84bd19c73e --- /dev/null +++ b/build.sbt @@ -0,0 +1,13 @@ +name := "dotty" + +organization := "lamp" + +scalaVersion := "2.10.0" + +scalaSource in Compile <<= baseDirectory / "src" + +scalacOptions in Global ++= Seq("-feature", "-deprecation", "-language:_") + +libraryDependencies <+= scalaVersion ( sv => "org.scala-lang" % "scala-reflect" % sv ) + +scalaSource in Test <<= baseDirectory / "test" \ No newline at end of file diff --git a/gitignore.SAMPLE b/gitignore.SAMPLE new file mode 100644 index 000000000000..189e089d438e --- /dev/null +++ b/gitignore.SAMPLE @@ -0,0 +1,5 @@ +.idea +.idea_modules +.gitignore +target +project/local-plugins.sbt diff --git a/project/build.properties b/project/build.properties new file mode 100644 index 000000000000..66ad72ce2eba --- /dev/null +++ b/project/build.properties @@ -0,0 +1 @@ +sbt.version=0.12.2 diff --git a/project/plugins.sbt b/project/plugins.sbt new file mode 100644 index 000000000000..b6864b47bbbc --- /dev/null +++ b/project/plugins.sbt @@ -0,0 +1,3 @@ +// Add personal SBT plugins for IDEs, etc to `local-plugins.sbt` +// +// e.g. addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.1.0") diff --git a/src/dotty/tools/dotc/config/Settings.scala b/src/dotty/tools/dotc/config/Settings.scala index eff9c245f5c0..bbd6aae80c5d 100644 --- a/src/dotty/tools/dotc/config/Settings.scala +++ b/src/dotty/tools/dotc/config/Settings.scala @@ -18,9 +18,9 @@ object Settings { private var values = ArrayBuffer(initialValues: _*) private var _wasRead: Boolean = false - def value(idx: Int) = { + def value(idx: Int): Any = { _wasRead = true - values + values(idx) } def update(idx: Int, x: Any): SettingsState = diff --git a/src/dotty/tools/dotc/core/Contexts.scala b/src/dotty/tools/dotc/core/Contexts.scala index c4c9e7764d78..451d8edd3339 100644 --- a/src/dotty/tools/dotc/core/Contexts.scala +++ b/src/dotty/tools/dotc/core/Contexts.scala @@ -137,7 +137,7 @@ object Contexts { } object NoContext extends Context { - val base = unsupported("base") + def base = unsupported("base") } class ContextBase extends ContextState with Transformers.TransformerBase diff --git a/src/dotty/tools/dotc/core/Transformers.scala b/src/dotty/tools/dotc/core/Transformers.scala index a87356f3991b..342994c47edf 100644 --- a/src/dotty/tools/dotc/core/Transformers.scala +++ b/src/dotty/tools/dotc/core/Transformers.scala @@ -6,7 +6,7 @@ import java.lang.AssertionError trait Transformers -object Transformers { +object Transformers { transSelf => trait TransformerBase { self: ContextBase => @@ -32,7 +32,8 @@ object Transformers { } object NoTransformer extends Transformer { - val phaseId = lastPhaseId + 1 + val phaseId = transSelf.lastPhaseId + 1 + override def lastPhaseId = phaseId - 1 // TODO JZ Probably off-by-N error here. def transform(ref: SingleDenotation)(implicit ctx: Context): SingleDenotation = unsupported("transform") } diff --git a/src/dotty/tools/dotc/core/Types.scala b/src/dotty/tools/dotc/core/Types.scala index aca1aef1d8a5..cdf01c009cf9 100644 --- a/src/dotty/tools/dotc/core/Types.scala +++ b/src/dotty/tools/dotc/core/Types.scala @@ -243,7 +243,7 @@ object Types { /** Map function over elements of an OrType, rebuilding with | */ def mapOr(f: Type => Type)(implicit ctx: Context): Type = this match { - case OrType(tp1, tp2) => tp1.mapAnd(f) | tp2.mapAnd(f) + case OrType(tp1, tp2) => tp1.mapOr(f) | tp2.mapOr(f) case _ => f(this) }