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
//>usingscala"3.nightly"imports.util.tag// letters t and higher worksealedtraitScalaInputobjectInputUnmarshaller {
defemptyMapVars= tag[ScalaInput](Map.empty[String, Any])
}
@main defmain() =
println(InputUnmarshaller.emptyMapVars)
tag.scala
packages.util// letters t and higher workobjecttag {
defapply[U] =newTagger[U]
sealedtraitTagged[U]
type@@[+T, U] =TwithTagged[U]
classTagger[U] {
defapply[T](t: T):T@@U= t.asInstanceOf[T@@U]
}
}
Output
Exception in thread "main" java.lang.ClassCastException:classscala.collection.immutable.Map$EmptyMap$ cannot be cast to classs.util.tag$Tagged (scala.collection.immutable.Map$EmptyMap$ and s.util.tag$Tagged are in unnamed module of loader 'app')
at InputUnmarshaller$.emptyMapVars(9283eaf8c80429e61efd1fb62418255a-main/Main.scala:7)
at Main$package$.main(9283eaf8c80429e61efd1fb62418255a-main/Main.scala:11)
at main.main(9283eaf8c80429e61efd1fb62418255a-main/Main.scala:10)
Expectation
Program should print Map(). In general I've noticed that package names starting with t and higher work, other don't, although I haven't tested enough to be 100% sure exactly which package names will work.
The text was updated successfully, but these errors were encountered:
I checked which tests would fail if I changed it to always erase to the left value and it ended up being just 3 tests: pos/i5139, neg/i5139, run/manifest-summoning. (Where all of them are expected)
@smarter Do you know if the "A <= B && B <= A iff A =:= B" property on compareErasedGlb is needed anywhere?
Compiler version
3.1.3
,3.2.2-RC1-bin-20220908-c11f5cb-NIGHTLY
Minimized code
Main.scala
tag.scala
Output
Expectation
Program should print
Map()
. In general I've noticed that package names starting witht
and higher work, other don't, although I haven't tested enough to be 100% sure exactly which package names will work.The text was updated successfully, but these errors were encountered: