anchor.diff:    
     visitAsExpression(AsExpression n){
       super.visitAsExpression(n);
  -    
  -    if (n.type.name.toString() == 'dynamic') {
  +
  +    AbstractType castType = _getAbstractType(new Name.FromIdentifier(n.type.name), source.library, source);
  +
  +    
  +    if (n.type.name.toString() == 'dynamic' || castType == null) {
         //as dynamic doesn't give you any info, so just make them equal.
         TypeIdentifier nodeIdent = new ExpressionTypeIdentifier(n);
         TypeIdentifier expIdent = new ExpressionTypeIdentifier(n.expression);
  
positive.code:     } else {
        // {T} \in [e as T]
        // {T} \in [e]
        AbstractType castType = _getAbstractType(new Name.FromIdentifier(n.type.name), source.library, source);
        types.put(n, castType);
        types.put(n.expression, castType);
      }
  
negative.code:   
    void add(AbstractType t) {
      //TODO (jln) If the type added is a free-type check if there already exists a free type and merge them.
      
      if (t == null) {
          print('gaaay');
          
      }
      
      if (_types.add(t))
        trigger(t);
    }
  