From 120e14fadf30b4c39f953832108d19b736dc6f2d Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Tue, 2 Oct 2012 11:21:16 -0700 Subject: Fix for rangepos crasher. wrapClassTagUnapply was generating an unpositioned tree which would crash under -Yrangepos. See SI-6338. --- test/files/neg/t3015.check | 5 +---- test/files/pos/classtag-pos.flags | 1 + test/files/pos/classtag-pos.scala | 5 +++++ 3 files changed, 7 insertions(+), 4 deletions(-) create mode 100644 test/files/pos/classtag-pos.flags create mode 100644 test/files/pos/classtag-pos.scala (limited to 'test/files') diff --git a/test/files/neg/t3015.check b/test/files/neg/t3015.check index 4a03c940f4..6948392bb0 100644 --- a/test/files/neg/t3015.check +++ b/test/files/neg/t3015.check @@ -3,7 +3,4 @@ t3015.scala:7: error: scrutinee is incompatible with pattern type; required: String val b(foo) = "foo" ^ -error: type mismatch; - found : _$1 - required: String -two errors found +one error found diff --git a/test/files/pos/classtag-pos.flags b/test/files/pos/classtag-pos.flags new file mode 100644 index 0000000000..281f0a10cd --- /dev/null +++ b/test/files/pos/classtag-pos.flags @@ -0,0 +1 @@ +-Yrangepos diff --git a/test/files/pos/classtag-pos.scala b/test/files/pos/classtag-pos.scala new file mode 100644 index 0000000000..768d2e27f4 --- /dev/null +++ b/test/files/pos/classtag-pos.scala @@ -0,0 +1,5 @@ +import scala.reflect.runtime.universe._ + +class A { + def f[T: TypeTag] = typeOf[T] match { case TypeRef(_, _, args) => args } +} -- cgit v1.2.3