From 910aa4b4b6b1db98148566ca0b46e026fd5e312d Mon Sep 17 00:00:00 2001 From: Martin Odersky Date: Thu, 25 Aug 2016 14:27:12 +0200 Subject: More tests recategorized --- tests/disabled/not-representable/pos/t8111.scala | 25 ++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 tests/disabled/not-representable/pos/t8111.scala (limited to 'tests/disabled/not-representable/pos') diff --git a/tests/disabled/not-representable/pos/t8111.scala b/tests/disabled/not-representable/pos/t8111.scala new file mode 100644 index 000000000..04a8e20de --- /dev/null +++ b/tests/disabled/not-representable/pos/t8111.scala @@ -0,0 +1,25 @@ +// structural types, cannot represent +trait T { + + def crashy(ma: Any): Unit = { + // okay + val f1 = (u: Unit) => ma + foo(f1)() + foo((u: Unit) => ma) + foo(0, (u: Any) => ma) apply () + + // crash due to side effects on the onwer of the symbol in the + // qualifier or arguments of the application during an abandoned + // names/defaults transform. The code type checkes because of + // autp-tupling which promotes and empty parmater list to `(): Unit` + foo((u: Any) => ma)() + + {{(u: Any) => ma}; this}.foo(0)() + + foo({def foo = ma; 0})() + + {def foo = ma; this}.foo(0)() + } + + def foo(f: Any): Any => Any +} -- cgit v1.2.3