You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
//>usingscala3.nightlyimportscala.language.experimental.namedTuplescaseclassCity(name: String, population: Int)
defgetCityInfo(city: City) =
city matchcaseCity(iam = n, confused = p) =>s"[City] $n has a population of $p !!!!!!!!!!"@main
defmain=valcity=City(name ="New York", population =8_000_000)
println(getCityInfo(city))
Output
[City] NewYork has a population of 8000000!!!!!!!!!!
Expectation
Compilation error, that iam and confused aren't fields of the class City
The text was updated successfully, but these errors were encountered:
Compiler version
91063dd
Minimized code
Output
Expectation
Compilation error, that
iam
andconfused
aren't fields of the classCity
The text was updated successfully, but these errors were encountered: