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
Previously, the following lead to a cycle (typing the extension method
requires typing its `Int` parameter, which forces completion of the
package object containing the top-level definition, which forces
completion of the extension method via the export clause):
trait MyExtensions:
extension (lhs: Int) def bash: Unit = {}
object MyExtensions extends MyExtensions
export MyExtensions.*
val fails = 1.bash
But curiously enough, simply defining `object MyExtensions` before
`trait MyExtensions` was enough to work around the issue. This happened
because typing the module val of the object forces the package object,
this in turns forces the extension method but because of the way
class completers work, this doesn't lead to a cycle.
Based on this experiment, this commit simply always forces the package
object before typing any definition in the package, so we don't run into
a cycle no matter the order in which definitions appear.
0 commit comments