예제 #1
0
 public override string CheckValidNarrowing(LookupCache next, LookupCache current)
 {
     if (current.Has(Source))
     {
         var parent_value = current[Source];
         var union_type   = AstTypeableNode.TypeFromClrType(parent_value.BackingType);
         if ((union_type & Mask) == 0)
         {
             return(String.Format("Value for “{0}” must be to {1}, but it is {2}.", Name, Mask, union_type));
         }
         else
         {
             next[this] = parent_value;
             return(null);
         }
     }
     else
     {
         return(null);
     }
 }
예제 #2
0
 public override bool NeedsLoad(LookupCache current)
 {
     return(current == null || !current.Has(Source) || must_unbox && current[Source].BackingType == typeof(object));
 }
예제 #3
0
 public override bool NeedsLoad(LookupCache current)
 {
     return(current == null || !current.Has(this));
 }