From 8c69f4da333f17290da26c3951fa9c8805014e47 Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Tue, 18 Sep 2012 17:21:35 +0200 Subject: SI-6336 Now also catches return types As Mark's comments on SI-6336 shows, we also need to disallow value classes as return types of structural types. --- test/files/neg/t6336.check | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'test/files/neg/t6336.check') diff --git a/test/files/neg/t6336.check b/test/files/neg/t6336.check index f6b35ad232..c3ddf81f21 100644 --- a/test/files/neg/t6336.check +++ b/test/files/neg/t6336.check @@ -1,4 +1,7 @@ t6336.scala:3: error: Parameter type in structural refinement may not refer to a user-defined value class val a = new { def y[T](x: X[T]) = x.i } ^ -one error found +t6336.scala:4: error: Result type in structural refinement may not refer to a user-defined value class + val b = new { def y[T](x: T): X[T] = new X(2) } + ^ +two errors found -- cgit v1.2.3