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
-- [E008] NotFoundError: tests\run\hello.scala:14:22-------------------------14| println(MyDynamic.literal())
|^^^^^^^^^^^^^^^^^|value applyDynamic is not a member of objectMyDynamic, but could be made available asan extension method.
||The following importmightfixtheproblem:||importreflect.Selectable.reflectiveSelectable|-- [E008] NotFoundError: tests\run\hello.scala:15:22-------------------------15| println(MyDynamic.literal("foobar"))
|^^^^^^^^^^^^^^^^^|value applyDynamic is not a member of objectMyDynamic, but could be made available asan extension method.
||The following importmightfixtheproblem:||importreflect.Selectable.reflectiveSelectable|-- [E008] NotFoundError: tests\run\hello.scala:16:22-------------------------16| println(MyDynamic.literal(foo ="Foo", bar =42))
|^^^^^^^^^^^^^^^^^| value applyDynamicNamed is not a member of objectMyDynamic3 errors found
…c treatment.
Previously, identifying when there was an inserted apply, which had
to be carried through the Dynamic treatment, was done on a
syntactical basis. This would mishandle cases written as
someContainer.someDynamic()
as it would think that this was an explicit dynamic call for
`"someDynamic"` on `someContainer` (although `someContainer` is not
even a `scala.Dynamic` itself, but `someContainer.someDynamic` is).
We now reliably detect inserted applys by looking at the result of
the pre-type-checking of the function part, and testing whether
there is a synthetic `Select(_, nme.apply)` node.
Minimized code
Output
Expectation
It runs and outputs the following:
Notes
This works in Scala 2.
Explicitly calling
.apply
makes it work in Dotty as well:This is necessary for Scala.js, because this is how
js.Dynamic.literal
is defined. All code usingjs.Dynamic.literal
hits this issue at the moment.The text was updated successfully, but these errors were encountered: