Skip to content

Commit 2d30854

Browse files
SethTisueKordyjan
authored andcommitted
compiler plugin Scaladoc: document phase requirement
fixes #18381 [Cherry-picked 521ac73]
1 parent f19f03b commit 2d30854

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

compiler/src/dotty/tools/dotc/plugins/Plugin.scala

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,9 @@ sealed trait Plugin {
4343
/** A standard plugin can be inserted into the normal compilation pipeline */
4444
trait StandardPlugin extends Plugin {
4545
/** Non-research plugins should override this method to return the phases
46+
*
47+
* The phases returned must be freshly constructed (not reused
48+
* and returned again on subsequent calls).
4649
*
4750
* @param options commandline options to the plugin.
4851
* @return a list of phases to be added to the phase plan
@@ -56,6 +59,9 @@ trait StandardPlugin extends Plugin {
5659
*/
5760
trait ResearchPlugin extends Plugin {
5861
/** Research plugins should override this method to return the new phase plan
62+
*
63+
* Any plugin phases included in the plan must be freshly constructed (not reused
64+
* and returned again on subsequent calls).
5965
*
6066
* @param options commandline options to the plugin, `-P:plugname:opt1,opt2` becomes List(opt1, opt2)
6167
* @param plan the given phase plan

0 commit comments

Comments
 (0)