summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Zaugg <jzaugg@gmail.com>2014-06-04 09:18:12 +0200
committerJason Zaugg <jzaugg@gmail.com>2014-06-04 09:18:12 +0200
commita6ecfa633a76162575ceb332b40ceed93eef490a (patch)
tree79260bb4e91b00c72acff965b03cd6e0ef49f312
parentb24e7573a17332606d9f9da49a397e02abec1b63 (diff)
parent300db2a1e3eefc2a6ed379c870bc7da42a26e69a (diff)
downloadscala-a6ecfa633a76162575ceb332b40ceed93eef490a.tar.gz
scala-a6ecfa633a76162575ceb332b40ceed93eef490a.tar.bz2
scala-a6ecfa633a76162575ceb332b40ceed93eef490a.zip
Merge remote-tracking branch 'origin/2.10.x' into merge/2.10.x-to-2.11.x-20140604
Conflicts: src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala
-rw-r--r--src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala4
-rw-r--r--test/files/pos/t8596.flags1
-rw-r--r--test/files/pos/t8596.scala7
-rw-r--r--test/files/presentation/t7915.check20
-rw-r--r--test/files/presentation/t7915/src/Foo.scala4
5 files changed, 33 insertions, 3 deletions
diff --git a/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala b/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala
index dceb0a47d8..284ab2f6f9 100644
--- a/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala
+++ b/src/compiler/scala/tools/nsc/typechecker/NamesDefaults.scala
@@ -174,8 +174,8 @@ trait NamesDefaults { self: Analyzer =>
// assigning the correct method symbol, typedSelect will just assign the type. the reason
// to still call 'typed' is to correctly infer singleton types, SI-5259.
val selectPos =
- if(qual.pos.isRange && baseFun.pos.isRange) qual.pos.union(baseFun.pos).withStart(Math.min(qual.pos.end, baseFun.pos.end))
- else baseFun.pos
+ if(qual.pos.isRange && baseFun1.pos.isRange) qual.pos.union(baseFun1.pos).withStart(Math.min(qual.pos.end, baseFun1.pos.end))
+ else baseFun1.pos
val f = blockTyper.typedOperator(Select(newQual, selected).setSymbol(baseFun1.symbol).setPos(selectPos))
if (funTargs.isEmpty) f
else TypeApply(f, funTargs).setType(baseFun.tpe)
diff --git a/test/files/pos/t8596.flags b/test/files/pos/t8596.flags
new file mode 100644
index 0000000000..281f0a10cd
--- /dev/null
+++ b/test/files/pos/t8596.flags
@@ -0,0 +1 @@
+-Yrangepos
diff --git a/test/files/pos/t8596.scala b/test/files/pos/t8596.scala
new file mode 100644
index 0000000000..bfed58eadf
--- /dev/null
+++ b/test/files/pos/t8596.scala
@@ -0,0 +1,7 @@
+class TypeTreeObjects {
+ class Container {
+ def typeParamAndDefaultArg[C](name: String = ""): String = ""
+ }
+ // crashed under -Yrangepos
+ new Container().typeParamAndDefaultArg[Any]()
+}
diff --git a/test/files/presentation/t7915.check b/test/files/presentation/t7915.check
index b18b4ddb55..0849aaa82b 100644
--- a/test/files/presentation/t7915.check
+++ b/test/files/presentation/t7915.check
@@ -9,3 +9,23 @@ askHyperlinkPos for `bar` at (7,22) Foo.scala
================================================================================
[response] found askHyperlinkPos for `bar` at (2,7) Foo.scala
================================================================================
+
+askHyperlinkPos for `Bar` at (8,11) Foo.scala
+================================================================================
+[response] found askHyperlinkPos for `Bar` at (1,7) Foo.scala
+================================================================================
+
+askHyperlinkPos for `baz` at (8,22) Foo.scala
+================================================================================
+[response] found askHyperlinkPos for `baz` at (2,31) Foo.scala
+================================================================================
+
+askHyperlinkPos for `Bar` at (9,11) Foo.scala
+================================================================================
+[response] found askHyperlinkPos for `Bar` at (1,7) Foo.scala
+================================================================================
+
+askHyperlinkPos for `baz` at (9,22) Foo.scala
+================================================================================
+[response] found askHyperlinkPos for `baz` at (2,31) Foo.scala
+================================================================================
diff --git a/test/files/presentation/t7915/src/Foo.scala b/test/files/presentation/t7915/src/Foo.scala
index a4166ae5b4..5c9ca36a6e 100644
--- a/test/files/presentation/t7915/src/Foo.scala
+++ b/test/files/presentation/t7915/src/Foo.scala
@@ -1,9 +1,11 @@
class Bar {
- def bar(b: Int = 2) {}
+ def bar(b: Int = 2) {}; def baz[X](b: Int = 2) {}
}
class Foo {
def foo() {
new Bar/*#*/().bar/*#*/()
+ new Bar/*#*/().baz/*#*/[Any]()
+ new Bar/*#*/().baz/*#*/()
}
}