From 77a44df63655dfa4a7dcad2148e76e2813f8623d Mon Sep 17 00:00:00 2001 From: Chris Kipp Date: Fri, 12 May 2023 08:37:13 +0200 Subject: [PATCH] test: add in regression test for #7653 --- tests/pos/i7653.scala | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 tests/pos/i7653.scala diff --git a/tests/pos/i7653.scala b/tests/pos/i7653.scala new file mode 100644 index 000000000000..8511b6eef69b --- /dev/null +++ b/tests/pos/i7653.scala @@ -0,0 +1,22 @@ +// https://github.com/lampepfl/dotty/issues/7653 + +object options2 { + type Option[T] = { + def isEmpty: Boolean + } + type None[T] = Option[T] + val none: () => Option[Nothing] = () => + new { + def isEmpty = true + } + val mkNone0: [T] => () => Option[Nothing] = [T] => + () => + new { + def isEmpty = true + } + val mkNone: [T] => () => Option[T] = [T] => + () => + new { + def isEmpty = true + } +}