Skip to content

Commit dfcaddb

Browse files
committed
Merge pull request #2 from retronym/topic/odds-and-ends
Topic/odds and ends
2 parents 25e0986 + 159bf9d commit dfcaddb

File tree

9 files changed

+55
-6
lines changed

9 files changed

+55
-6
lines changed

.gitattributes

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# These files are text and should be normalized (convert crlf => lf)
2+
*.c text
3+
*.check text
4+
*.css text
5+
*.html text
6+
*.java text
7+
*.js text
8+
*.sbt text
9+
*.scala text
10+
*.sh text
11+
*.txt text
12+
*.xml text
13+
14+
# Windows-specific files get windows endings
15+
*.bat eol=crlf
16+
*.cmd eol=crlf
17+
*-windows.tmpl eol=crlf
18+
19+
# Some binary file types for completeness
20+
# (binary is a macro for -text -diff)
21+
*.dll binary
22+
*.gif binary
23+
*.jpg binary
24+
*.png binary
25+
*.class binary
26+
*.jar binary

build.sbt

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name := "dotty"
2+
3+
organization := "lamp"
4+
5+
scalaVersion := "2.10.0"
6+
7+
scalaSource in Compile <<= baseDirectory / "src"
8+
9+
scalacOptions in Global ++= Seq("-feature", "-deprecation", "-language:_")
10+
11+
libraryDependencies <+= scalaVersion ( sv => "org.scala-lang" % "scala-reflect" % sv )
12+
13+
scalaSource in Test <<= baseDirectory / "test"

gitignore.SAMPLE

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.idea
2+
.idea_modules
3+
.gitignore
4+
target
5+
project/local-plugins.sbt

project/build.properties

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
sbt.version=0.12.2

project/plugins.sbt

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// Add personal SBT plugins for IDEs, etc to `local-plugins.sbt`
2+
//
3+
// e.g. addSbtPlugin("com.github.mpeltonen" % "sbt-idea" % "1.1.0")

src/dotty/tools/dotc/config/Settings.scala

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ object Settings {
1818
private var values = ArrayBuffer(initialValues: _*)
1919
private var _wasRead: Boolean = false
2020

21-
def value(idx: Int) = {
21+
def value(idx: Int): Any = {
2222
_wasRead = true
23-
values
23+
values(idx)
2424
}
2525

2626
def update(idx: Int, x: Any): SettingsState =

src/dotty/tools/dotc/core/Contexts.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ object Contexts {
137137
}
138138

139139
object NoContext extends Context {
140-
val base = unsupported("base")
140+
def base = unsupported("base")
141141
}
142142

143143
class ContextBase extends ContextState with Transformers.TransformerBase

src/dotty/tools/dotc/core/Transformers.scala

+3-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import java.lang.AssertionError
66

77
trait Transformers
88

9-
object Transformers {
9+
object Transformers { transSelf =>
1010

1111
trait TransformerBase { self: ContextBase =>
1212

@@ -32,7 +32,8 @@ object Transformers {
3232
}
3333

3434
object NoTransformer extends Transformer {
35-
val phaseId = lastPhaseId + 1
35+
val phaseId = transSelf.lastPhaseId + 1
36+
override def lastPhaseId = phaseId - 1 // TODO JZ Probably off-by-N error here.
3637
def transform(ref: SingleDenotation)(implicit ctx: Context): SingleDenotation =
3738
unsupported("transform")
3839
}

src/dotty/tools/dotc/core/Types.scala

+1-1
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ object Types {
243243

244244
/** Map function over elements of an OrType, rebuilding with | */
245245
def mapOr(f: Type => Type)(implicit ctx: Context): Type = this match {
246-
case OrType(tp1, tp2) => tp1.mapAnd(f) | tp2.mapAnd(f)
246+
case OrType(tp1, tp2) => tp1.mapOr(f) | tp2.mapOr(f)
247247
case _ => f(this)
248248
}
249249

0 commit comments

Comments
 (0)