anchor.diff:          return buildClosedTypeFromDartType(functionType.type);
   
         case ElementKind.TYPE_PARAMETER:
  -        return new ast.TypeParameterType(
  -            scope.getTypeParameterReference(element));
  +        var typeParameter = scope.getTypeParameterReference(element);
  +        if (!scope.allowClassTypeParameters &&
  +            typeParameter.parent is ast.Class) {
  +          return const ast.InvalidType();
  +        }
  +        return new ast.TypeParameterType(typeParameter);
   
         case ElementKind.COMPILATION_UNIT:
         case ElementKind.CONSTRUCTOR:
  
positive.code:       DartType type, List<TypeParameterElement> boundVariables) {
      if (type is TypeParameterType) {
        if (boundVariables == null || boundVariables.contains(type)) {
          return new ast.TypeParameterType(
              scope.getTypeParameterReference(type.element));
        } else {
          return const ast.DynamicType();
        }
  
negative.code:   ast.Class get currentClass => currentMember.enclosingClass;
  
    bool get allowThis => _memberHasThis(currentMember);
  
    @override
    bool get allowClassTypeParameters {
      return currentMember.isInstanceMember || currentMember is ast.Constructor;
    }
  
    /// Returns a string for debugging use, indicating the location of the member
    /// being built.
  