anchor.diff:  import '../ast.dart';
   import '../type_algebra.dart';
   
  -/// Erases all function type parameter lists and replaces all uses of them with
  -/// their upper bounds.
  +/// This pass is a temporary measure to run strong mode code in the VM, which
  +/// does not yet have the necessary runtime support.
   ///
  -/// This is a temporary measure to run strong mode code in the VM, which does
  -/// not yet support function type parameters.
  +/// Function type parameter lists are cleared and all uses of a function type
  +/// parameter are replaced by its upper bound.
  +///
  +/// All uses of type parameters in constants are replaced by 'dynamic'.
   ///
   /// This does not preserve dynamic type safety.
   class Erasure extends Transformer {
     final Map<TypeParameter, DartType> substitution = <TypeParameter, DartType>{};
  +  final Map<TypeParameter, DartType> constantSubstitution =
  +      <TypeParameter, DartType>{};
  +
  +  int constantContexts = 0;
   
     void transform(Program program) {
       program.accept(this);
     }
   
  +  void pushConstantContext() {
  +    ++constantContexts;
  +  }
  +
  +  void popConstantContext() {
  +    --constantContexts;
  +  }
  +
  +  bool get isInConstantContext => constantContexts > 0;
  +
     @override
  -  visitDartType(DartType type) => substitute(type, substitution);
  +  visitDartType(DartType type) {
  +    type = substitute(type, substitution);
  +    if (isInConstantContext) {
  +      type = substitute(type, constantSubstitution);
  +    }
  +    return type;
  +  }
  +
  +  @override
  +  visitClass(Class node) {
  +    for (var parameter in node.typeParameters) {
  +      constantSubstitution[parameter] = const DynamicType();
  +    }
  +    node.transformChildren(this);
  +    constantSubstitution.clear();
  +    return node;
  +  }
   
     @override
     visitProcedure(Procedure node) {
  
positive.code:     node.transformChildren(this);
      return node;
    }
  }
  
negative.code:       assert(node.enclosingClass.typeParameters.length ==
            node.function.typeParameters.length);
        // Factories can have function type parameters as long as they correspond
        // exactly to those on the enclosing class. However, these type parameters
        // may still not be in a constant.
        for (var parameter in node.function.typeParameters) {
          constantSubstitution[parameter] = const DynamicType();
        }
        // Skip the visitFunctionNode but traverse body.
        node.function.transformChildren(this);
        node.function.typeParameters.forEach(constantSubstitution.remove);
      } else {
        node.transformChildren(this);
      }
  