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 + } +}