From 78db4cf7fe84fe2431fd8204a84d385e0fe8141d Mon Sep 17 00:00:00 2001 From: Burak Emir Date: Wed, 29 Nov 2006 18:05:55 +0000 Subject: testcase for killoption --- test/pending/run/testSome.scala | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 test/pending/run/testSome.scala (limited to 'test/pending/run') diff --git a/test/pending/run/testSome.scala b/test/pending/run/testSome.scala new file mode 100644 index 0000000000..ee5e807151 --- /dev/null +++ b/test/pending/run/testSome.scala @@ -0,0 +1,22 @@ +object testSome { + + val x: Option[String] = Some("foo") + + val x1: Option[Int] = Some(3) + + val y: Option[String] = None + + val y1: Option[Int] = None + + + Console.println(x.isEmpty) // x ne null + + Console.println(x1.isEmpty) + + Console.println(x.get) // x + + Console.println(x1.get) + + def f(x:String) = Some(x) + x.flatMap(&f) +} -- cgit v1.2.3