return
}
+// processDelayed processes all delayed actions pushed after top.
+func (check *Checker) processDelayed(top int) {
+ // If each delayed action pushes a new action, the
+ // stack will continue to grow during this loop.
+ // However, it is only processing functions (which
+ // are processed in a delayed fashion) that may
+ // add more actions (such as nested functions), so
+ // this is a sufficiently bounded process.
+ for i := top; i < len(check.delayed); i++ {
+ check.delayed[i]() // may append to check.delayed
+ }
+ assert(top <= len(check.delayed)) // stack must not have shrunk
+ check.delayed = check.delayed[:top]
+}
+
func (check *Checker) processFinals() {
n := len(check.finals)
for _, f := range check.finals {
func (a inSourceOrder) Less(i, j int) bool { return a[i].order() < a[j].order() }
func (a inSourceOrder) Swap(i, j int) { a[i], a[j] = a[j], a[i] }
-// processDelayed processes all delayed actions pushed after top.
-func (check *Checker) processDelayed(top int) {
- for len(check.delayed) > top {
- i := len(check.delayed) - 1
- f := check.delayed[i]
- check.delayed = check.delayed[:i]
- f() // may append to check.delayed
- }
-}
-
// unusedImports checks for unused imports.
func (check *Checker) unusedImports() {
// if function bodies are not checked, packages' uses are likely missing - don't check