anchor.diff:        'endFormalParameters 0 ( ) MemberKind.GeneralizedFunctionType',
         'endFunctionType Function ',
       ]);
  -    tComplex('void Function<T>()');
  -    tComplex('void Function(int)');
  -    tComplex('void Function<T>(int)');
  -    tComplex('void Function(int x)');
  -    tComplex('void Function<T>(int x)');
  -    tComplex('void Function<T>(int x) Function<T>(int x)');
  -  }
  +    expectComplexInfo('void Function<T>()');
  +    expectComplexInfo('void Function(int)');
  +    expectComplexInfo('void Function<T>(int)');
  +    expectComplexInfo('void Function(int x)');
  +    expectComplexInfo('void Function<T>(int x)');
  +    expectComplexInfo('void Function<T>(int x) Function<T>(int x)');
  +  }
  +}
  +
  +void expectInfo(expectedInfo, String source,
  +    {bool required, String expectedAfter, List<String> expectedCalls}) {
  +  Token start = scan(source);
  +  if (required == null) {
  +    compute(expectedInfo, source, start, true, expectedAfter, expectedCalls);
  +    compute(expectedInfo, source, start, false, expectedAfter, expectedCalls);
  +  } else {
  +    compute(
  +        expectedInfo, source, start, required, expectedAfter, expectedCalls);
  +  }
  +}
  +
  +void expectComplexInfo(String source,
  +    {bool required, String tokenAfter, List<String> expectedCalls}) {
  +  expectInfo(const isInstanceOf<ComplexTypeInfo>(), source,
  +      required: required,
  +      expectedAfter: tokenAfter,
  +      expectedCalls: expectedCalls);
  +}
  +
  +void compute(expectedInfo, String source, Token start, bool required,
  +    String expectedAfter, List<String> expectedCalls) {
  +  TypeInfo typeInfo = computeType(start, required);
  +  expect(typeInfo, expectedInfo, reason: source);
  +  if (typeInfo is ComplexTypeInfo) {
  +    TypeInfoListener listener = new TypeInfoListener();
  +    Parser parser = new Parser(listener);
  +    expect(typeInfo.start, start.next, reason: source);
  +    expectEnd(expectedAfter, typeInfo.skipType(start));
  +    expectEnd(expectedAfter, typeInfo.parseType(start, parser));
  +    if (expectedCalls != null) {
  +      // TypeInfoListener listener2 = new TypeInfoListener();
  +      // new Parser(listener2).parseType(start, TypeContinuation.Required);
  +      // print('[');
  +      // for (String call in listener2.calls) {
  +      //   print("'$call',");
  +      // }
  +      // print(']');
  +
  +      expect(listener.calls, expectedCalls, reason: source);
  +    }
  +  }
  +}
  +
  +void expectEnd(String tokenAfter, Token end) {
  +  if (tokenAfter == null) {
  +    expect(end.isEof, isFalse);
  +    expect(end.next.isEof, isTrue);
  +  } else {
  +    expect(end.next.lexeme, tokenAfter);
  +  }
  +}
  +
  +Token scan(String source) {
  +  Token start = scanString(source).tokens;
  +  while (start is ErrorToken) {
  +    start = start.next;
  +  }
  +  return new SyntheticToken(TokenType.EOF, 0)..setNext(start);
   }
   
   class TypeInfoListener implements Listener {
  
positive.code:       'endFormalParameters 1 ( ) MemberKind.GeneralizedFunctionType',
        'endFunctionType Function ',
      ]);
      tComplex('Function(int x)');
      tComplex('Function<T>(int x)');
      tComplex('Function<T>(int x) Function<T>(int x)');
  
      tComplex('C Function()');
      tComplex('C Function<T>()');
      tComplex('C Function(int)');
      tComplex('C Function<T>(int)');
      tComplex('C Function(int x)');
      tComplex('C Function<T>(int x)');
      tComplex('C Function<T>(int x) Function<T>(int x)');
      tComplex('C.a Function<T>(int x) Function<T>(int x)');
      tComplex('C<T> Function<T>(int x) Function<T>(int x)');
      tComplex('C.a<T> Function<T>(int x) Function<T>(int x)', expectedCalls: [
        'beginTypeVariables <',
        'beginTypeVariable T',
        'beginMetadataStar T',
        'endMetadataStar 0',
        'handleIdentifier T typeVariableDeclaration',
        'handleNoType T',
        'endTypeVariable > null',
        'endTypeVariables 1 < >',
        'beginFunctionType C',
        'beginTypeVariables <',
        'beginTypeVariable T',
        'beginMetadataStar T',
        'endMetadataStar 0',
        'handleIdentifier T typeVariableDeclaration',
        'handleNoType T',
        'endTypeVariable > null',
        'endTypeVariables 1 < >',
        'beginFunctionType C',
        'handleIdentifier C prefixedTypeReference',
        'handleIdentifier a typeReferenceContinuation',
        'handleQualified .',
  
negative.code:       'endFormalParameters 1 ( ) MemberKind.GeneralizedFunctionType',
        'endFunctionType Function ',
      ]);
      expectComplexInfo('Function<T>(int)', expectedCalls: [
        'beginTypeVariables <',
        'beginTypeVariable T',
        'beginMetadataStar T',
  