anchor.diff:          } else {
             listener.handleNoType(begin);
           }
  -        return parseNamedFunctionRest(begin, name, formals, true);
  +        if (beforeName.next != name)
  +          throw new StateError("beforeName.next != name");
  +        return parseNamedFunctionRest(begin, beforeName.next, formals, true);
   
         case TypeContinuation.VariablesDeclarationOrExpression:
           if (looksLikeType &&
  
positive.code:         if (optional("<", token.next)) {
            Token close = closeBraceTokenFor(token.next);
            if (close != null && optional(">", close)) {
              token = close;
            } else {
              break; // Not a function type.
  
negative.code:           Token saved = token;
            commitType();
            token = saved;
            // We need to recompute the before tokens because [commitType] can
            // cause synthetic tokens to be inserted.
            beforeToken = previousToken(beforeToken, token);
            beforeNameToken = previousToken(beforeNameToken, nameToken);
          }
  
          if (nameContext != null) {
            nameToken = ensureIdentifier(beforeNameToken.next, nameContext);
            // We need to recompute the before tokens because [ensureIdentifier]
            // can cause synthetic tokens to be inserted.
            beforeToken = previousToken(beforeToken, token);
            beforeNameToken = previousToken(beforeNameToken, nameToken);
          } else {
            listener.handleNoName(nameToken);
          }
  