From e2639e08b097aa9e5cb1f9a38ef37c6caec05874 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Sun, 9 Apr 2017 17:01:15 +0200 Subject: Fix #2198: Don't widen module singletons Since module classes are a compiler-generated construct that's not directly visible to programmers, it seems better not to automatically widen a module singleton to its underlying class. Fixes #2198. --- tests/pos/i2198.scala | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 tests/pos/i2198.scala (limited to 'tests') diff --git a/tests/pos/i2198.scala b/tests/pos/i2198.scala new file mode 100644 index 000000000..62ae7e8b5 --- /dev/null +++ b/tests/pos/i2198.scala @@ -0,0 +1,6 @@ +object Test { + val nil = scala.collection.immutable.Nil + def f(x: nil.type): Int = 3 + + f(scala.collection.immutable.Nil) +} -- cgit v1.2.3