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
packagedynamicrashimportscala.language.dynamicsclassConfigtraitExtractor[A] {
defextract(config: Config, name: String):A
}
objectExtractor {
// note missing "implicit"valstringExtractor=newExtractor[String] {
overridedefextract(config: Config, name: String):String=???
}
}
classWorkspaceextendsDynamic {
valconfig:Config=newConfigdefselectDynamic[A](name: String)(implicitextractor: Extractor[A]):A=
extractor.extract(config, name)
}
objectMain {
valstorage=newWorkspace// this line works fine// val a = storage.foo// this line crashes the compiler ("head of empty list")// in ContextErrors$InferencerContextErrors$InferErrorGen$.NotWithinBoundsErrorMessage// println(storage.foo[String])// this line crashes the compiler in different way ("unknown type")// in the backend, warning: an unexpected type representation reached the compiler backend while compiling Test.scala: <error>// println(storage.foo)
}
The text was updated successfully, but these errors were encountered:
reported on https://groups.google.com/forum/#!topic/scala-internals/9VQXHholnsY
The text was updated successfully, but these errors were encountered: