code: func (a *funcCompiler) checkLabels() {
  	nerr := a.numError()
  	for _, l := range a.labels {
  		if !l.resolved.IsValid() {
  			a.diagAt(l.used, "label %s not defined", l.name)
  		}
  	}
  	if nerr != a.numError() {
  		// Don't check scopes if we have unresolved labels
  		return
  	}
  
  	// Executing the "goto" statement must not cause any variables
  	// to come into scope that were not already in scope at the
  	// point of the goto.
  	a.flow.gotosObeyScopes(a.compiler)
  }
docs: // Checks that labels were resolved and that all jumps obey scoping
  // rules.  Reports an error and set fc.err if any check fails.