diff options
Diffstat (limited to 'test/files/run/t6631.scala')
-rw-r--r-- | test/files/run/t6631.scala | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/test/files/run/t6631.scala b/test/files/run/t6631.scala new file mode 100644 index 0000000000..e472b83d50 --- /dev/null +++ b/test/files/run/t6631.scala @@ -0,0 +1,18 @@ +import reflect.ClassTag + +object Test extends App { + def intercept[T <: Throwable : ClassTag](act: => Any) = try { + act + } catch { + case x: Throwable => + val cls = implicitly[ClassTag[T]].runtimeClass + assert(cls.isInstance(x), (x.getClass, x, cls).toString) + } + assert(s"""\f\r\n\t""" == "\f\r\n\t") + + import StringContext.InvalidEscapeException + intercept[InvalidEscapeException](s"""\""") + intercept[InvalidEscapeException](s"""\x""") + intercept[InvalidEscapeException](s"\") + +} |