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:   bool containsKey(TypeIdentifier ident) => _typeMap.containsKey(ident);  
    
    void put(dynamic i, AbstractType t){
      
      if (t == null) {
            print('fuuuck');
      }
      
      
      TypeIdentifier ident = TypeIdentifier.ConvertToTypeIdentifier(i);
      if (!_typeMap.containsKey(ident))
        _typeMap[ident] = new TypeVariable();
  