Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Topic/odds and ends #2

Merged
merged 6 commits into from
Feb 11, 2013
Merged
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
26 changes: 26 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -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
13 changes: 13 additions & 0 deletions build.sbt
Original file line number Diff line number Diff line change
@@ -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"
5 changes: 5 additions & 0 deletions gitignore.SAMPLE
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
.idea
.idea_modules
.gitignore
target
project/local-plugins.sbt
1 change: 1 addition & 0 deletions project/build.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
sbt.version=0.12.2
3 changes: 3 additions & 0 deletions project/plugins.sbt
Original file line number Diff line number Diff line change
@@ -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")
4 changes: 2 additions & 2 deletions src/dotty/tools/dotc/config/Settings.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
2 changes: 1 addition & 1 deletion src/dotty/tools/dotc/core/Contexts.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 3 additions & 2 deletions src/dotty/tools/dotc/core/Transformers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import java.lang.AssertionError

trait Transformers

object Transformers {
object Transformers { transSelf =>

trait TransformerBase { self: ContextBase =>

Expand All @@ -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")
}
Expand Down
2 changes: 1 addition & 1 deletion src/dotty/tools/dotc/core/Types.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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)
}

Expand Down