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
importscala.language.dynamicstraitDynamicHello[E] extendsDynamic:extension (ref: E)
defselectDynamic(
field: String
):AnygivenDynamicHello[String] withextension (ref: String)
overridedefselectDynamic(field: String) =s"Hello $field"// Doesn't compile with error:// value hello is not a member of String [15:6]defbadHello(str: String) =
str.hello
// compile, and prove `DynamicHello[String]` does give to `String`defgoodHello(str: String) =
str.selectDynamic("hello")
Output
[info] compiling 1Scala source to xxx ...
[error] -- [E008] NotFoundError:Example.scala:15:6
[error] 18| str.hello
[error] |^^^^^^^^^
[error] | value hello is not a member of String
[error] one error found
Uh oh!
There was an error while loading. Please reload this page.
Compiler version
3.5.2
Minimized code
Output
May relate to #17106
The text was updated successfully, but these errors were encountered: