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
The meaning of the following comment in Plugins.scala is that loadAllFrom in Plugin.scala must ensure uniqueness.
The continuations plugin relies on this behavior, for instance. Once instantiated, a plugin is free to muck with its global. (A Subcomponent has no lifecycle for init and destroy operations.)
If two continuations plugins are specified, the second, "stale" checker will not be "enabled." The enabled flag is propagated from the (proper) plugin to its subcomponents and to its checkers.
// Each plugin must only be instantiated once. A common pattern// is to register annotation checkers during object construction, so// creating multiple plugin instances will leave behind stale checkers.
Sample confusing output, which also occurs on 2.10 if $CJ is a nefarious file name like my-continuations.jar:
$ scalac -verbose -Ylog:all -P:continuations:enable -Xplugin:$CJ t1807.scala
***
[log <no phase>] instantiated cps plugin: scala.tools.selectivecps.SelectiveCPSPlugin@6fc33c70
[log <no phase>] instantiated cps plugin: scala.tools.selectivecps.SelectiveCPSPlugin@7ab51662
[loaded plugin continuations]
[skipping a repeated plugin: continuations]
***
t1807.scala:10:error: this code must be compiled with the Scala continuations plugin enabled
valf: (() =>Int@cps[Int]) = () =>1
^
[loaded classfile/home/apm/projects/scala-pick/build/pack/lib/scala-library.jar(scala/util/continuations/cpsPlus.class) in 1ms]
t1807.scala:10:error: this code must be compiled with the Scala continuations plugin enabled
valf: (() =>Int@cps[Int]) = () =>1
^
***
four errors found
That's one more error than if you don't specify -P::enabled at all, so go figure.
The text was updated successfully, but these errors were encountered:
All is as it was before, and the timeline has been restored in which the duplication is silently glossed over.
It might be nice to issue a warning, in case someone is actually trying to monkey with the plugin in question.
The state of the class path is not specified, so it's not obvious whether it ought to prefer -Xpluginsdir or -Xplugin:myplugin.jar. Presumably the answer is either pluginsdir because it's either earlier on the class path or actually on a parent class loader, or myplugin.jar because I specifically asked for it.
The meaning of the following comment in Plugins.scala is that
loadAllFrom
in Plugin.scala must ensure uniqueness.The continuations plugin relies on this behavior, for instance. Once instantiated, a plugin is free to muck with its global. (A Subcomponent has no lifecycle for init and destroy operations.)
If two continuations plugins are specified, the second, "stale" checker will not be "enabled." The enabled flag is propagated from the (proper) plugin to its subcomponents and to its checkers.
Sample confusing output, which also occurs on 2.10 if $CJ is a nefarious file name like my-continuations.jar:
That's one more error than if you don't specify -P::enabled at all, so go figure.
The text was updated successfully, but these errors were encountered: