diff options
-rw-r--r-- | build.number | 2 | ||||
-rw-r--r-- | src/compiler/scala/tools/nsc/typechecker/Implicits.scala | 2 | ||||
-rw-r--r-- | test/files/pos/t8617.flags | 1 | ||||
-rw-r--r-- | test/files/pos/t8617.scala | 10 |
4 files changed, 13 insertions, 2 deletions
diff --git a/build.number b/build.number index 63a55339b9..4a0898529e 100644 --- a/build.number +++ b/build.number @@ -1,7 +1,7 @@ #Tue Sep 11 19:21:09 CEST 2007 version.major=2 version.minor=11 -version.patch=1 +version.patch=2 # This is the -N part of a version. if it's 0, it's dropped from maven versions. version.bnum=0 diff --git a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala index d87090fa46..73c3e6f016 100644 --- a/src/compiler/scala/tools/nsc/typechecker/Implicits.scala +++ b/src/compiler/scala/tools/nsc/typechecker/Implicits.scala @@ -1306,7 +1306,7 @@ trait Implicits { } def wrapResult(tree: Tree): SearchResult = - if (tree == EmptyTree) SearchFailure else new SearchResult(tree, EmptyTreeTypeSubstituter, Nil) + if (tree == EmptyTree) SearchFailure else new SearchResult(atPos(pos.focus)(tree), EmptyTreeTypeSubstituter, Nil) /** Materializes implicits of predefined types (currently, manifests and tags). * Will be replaced by implicit macros once we fix them. diff --git a/test/files/pos/t8617.flags b/test/files/pos/t8617.flags new file mode 100644 index 0000000000..281f0a10cd --- /dev/null +++ b/test/files/pos/t8617.flags @@ -0,0 +1 @@ +-Yrangepos diff --git a/test/files/pos/t8617.scala b/test/files/pos/t8617.scala new file mode 100644 index 0000000000..fc825bbcba --- /dev/null +++ b/test/files/pos/t8617.scala @@ -0,0 +1,10 @@ +object Test { + def foo[A] = implicitly[OptManifest[A]] // was "unpositioned tree" under -Yrangepos + + // These did not crash, but testing for good measure. + implicitly[OptManifest[String]] + implicitly[Manifest[String]] + + implicitly[reflect.ClassTag[String]] + implicitly[reflect.runtime.universe.TypeTag[String]] +} |