diff options
author | Lukas Rytz <lukas.rytz@typesafe.com> | 2015-03-27 09:30:30 +0100 |
---|---|---|
committer | Lukas Rytz <lukas.rytz@typesafe.com> | 2015-03-27 09:30:30 +0100 |
commit | a2447859fe5722c7d6dde87bf4ea03eee2efbdca (patch) | |
tree | a990c378907391c65a6815119db2fe96a51c55da | |
parent | 8a54e0aef3859bac22290bd88a745efb70dc39fb (diff) | |
parent | 67ed11205ce406dd8694e7197296b54ad9e5fee5 (diff) | |
download | scala-a2447859fe5722c7d6dde87bf4ea03eee2efbdca.tar.gz scala-a2447859fe5722c7d6dde87bf4ea03eee2efbdca.tar.bz2 scala-a2447859fe5722c7d6dde87bf4ea03eee2efbdca.zip |
Merge pull request #4409 from lrytz/t9174-test
SI-9174 test case
-rw-r--r-- | test/files/run/t9174.check | 19 | ||||
-rw-r--r-- | test/files/run/t9174.scala | 11 |
2 files changed, 30 insertions, 0 deletions
diff --git a/test/files/run/t9174.check b/test/files/run/t9174.check new file mode 100644 index 0000000000..9320a081ff --- /dev/null +++ b/test/files/run/t9174.check @@ -0,0 +1,19 @@ +Type in expressions to have them evaluated. +Type :help for more information. + +scala> import scala.util.{Success, Failure} +import scala.util.{Success, Failure} + +scala> def f1(b: Boolean) = if (b) Left(1) else Right(2) +f1: (b: Boolean)scala.util.Either[Int,Int] + +scala> def f2(b: Boolean) = if (b) Nil else 1 :: Nil +f2: (b: Boolean)List[Int] + +scala> def f3(b: Boolean) = if (b) Stream.Empty else new Stream.Cons(1, Stream.Empty) +f3: (b: Boolean)scala.collection.immutable.Stream[Int] + +scala> def f4(b: Boolean) = if (b) Success(1) else Failure(new Exception("")) +f4: (b: Boolean)scala.util.Try[Int] + +scala> :quit diff --git a/test/files/run/t9174.scala b/test/files/run/t9174.scala new file mode 100644 index 0000000000..0c70e9bca9 --- /dev/null +++ b/test/files/run/t9174.scala @@ -0,0 +1,11 @@ +import scala.tools.partest.ReplTest + +object Test extends ReplTest { + def code = """ + |import scala.util.{Success, Failure} + |def f1(b: Boolean) = if (b) Left(1) else Right(2) + |def f2(b: Boolean) = if (b) Nil else 1 :: Nil + |def f3(b: Boolean) = if (b) Stream.Empty else new Stream.Cons(1, Stream.Empty) + |def f4(b: Boolean) = if (b) Success(1) else Failure(new Exception("")) + |""".stripMargin +} |