| 254 | |
| 255 | // ---------------------------------------------------------- |
| 256 | public final Type meet(Type t) { |
| 257 | // Shortcut for the self case |
| 258 | if( t == this ) return this; |
| 259 | // Same-type is always safe in the subclasses |
| 260 | if( _type==t._type ) return xmeet(t); |
| 261 | // TypeNil vs TypeNil meet |
| 262 | if( this instanceof TypeNil ptr0 && t instanceof TypeNil ptr1 ) |
| 263 | return ptr0.nmeet(ptr1); |
| 264 | // Reverse; xmeet 2nd arg is never "is_simple" and never equal to "this". |
| 265 | if( is_simple() ) return this.xmeet(t ); |
| 266 | if( t.is_simple() ) return t .xmeet(this); |
| 267 | return Type.BOTTOM; // Mixing 2 unrelated types |
| 268 | } |
| 269 | |
| 270 | // Compute meet right now. Overridden in subclasses. |
| 271 | // Handle cases where 'this.is_simple()' and unequal to 't'. |