From 3270d8e85b4e1b1b23a1db7eac618d0c36f41af2 Mon Sep 17 00:00:00 2001 From: Chris Kipp Date: Mon, 15 May 2023 14:29:29 +0200 Subject: [PATCH] test: add in a regression test for #14582 [skip community_build] closes #14582 --- tests/run/i14582.scala | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 tests/run/i14582.scala diff --git a/tests/run/i14582.scala b/tests/run/i14582.scala new file mode 100644 index 000000000000..bce33aa170b2 --- /dev/null +++ b/tests/run/i14582.scala @@ -0,0 +1,18 @@ +// https://github.com/lampepfl/dotty/issues/14582 +@main def Test() = + val map = Map( + "a" -> 1, + "b" -> 2 + ) + + val mapView = map.view + + val optionMapView = Some(mapView) + + val listOfTuples: List[(String, String)] = List(("c", "d"), ("e", "f")) + + val mapViewWithDefault = optionMapView.getOrElse(Map()) + + val result = mapViewWithDefault ++ listOfTuples + + result.toSeq