Skip to content

Commit cfc51b0

Browse files
authored
fix issue #20267 with regression test (#20506)
As mentioned in #20267, the new desugaring from #20497 seems to fix the issue fixes #20267
2 parents 01b404f + 0345a3c commit cfc51b0

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

Diff for: tests/run/named-tuples.scala

+9
Original file line numberDiff line numberDiff line change
@@ -117,3 +117,12 @@ object Conv:
117117
def f22(x: (String, Int)) = x._1
118118
def f22(x: String) = x
119119
f22(bob)
120+
121+
object SingletonExpectedTypes:
122+
// original code from issue https://github.com/scala/scala3/issues/20267
123+
type TripleSingle = ("Lausanne", 1000, 140000)
124+
type CitySingle = (name: "Lausanne", zip: 1000, pop: 140000)
125+
126+
def test =
127+
val tripleSingle: TripleSingle = ("Lausanne", 1000, 140000) // OK
128+
val citySingle: CitySingle = (name = "Lausanne", zip = 1000, pop = 140000) // error

0 commit comments

Comments
 (0)