From cbcf3f505144297ad197d0086ea7a4c4f1fbb598 Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Mon, 29 Nov 2010 22:20:39 +0000 Subject: "I invite everyone to change this rule, and obs... "I invite everyone to change this rule, and observe what breaks!" This much beloved comment from #1208 has been on my radar for two years. The worm has turned. Closes #1208. The inferred type of an object is now Foo.type instead of "object Foo". What once was this: scala> val x: Map[Int, Singleton] = Map(1 -> None) :5: error: type mismatch; found : (Int, object None) required: (Int, Singleton) Now exudes a pleasing aura of workingness: scala> val x: Map[Int, Singleton] = Map(1 -> None) x: Map[Int,Singleton] = Map(1 -> None) No review. --- test/files/pos/bug1208.scala | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 test/files/pos/bug1208.scala (limited to 'test/files/pos') diff --git a/test/files/pos/bug1208.scala b/test/files/pos/bug1208.scala new file mode 100644 index 0000000000..9ac783d39a --- /dev/null +++ b/test/files/pos/bug1208.scala @@ -0,0 +1,4 @@ +object Test { + object Foo + val f: Option[Foo.type] = Some(Foo) +} -- cgit v1.2.3