| 135 | |
| 136 | // ---------------------------------------------------------- |
| 137 | public final Type meet(Type t) { |
| 138 | // Shortcut for the self case |
| 139 | if( t == this ) return this; |
| 140 | // Same-type is always safe in the subclasses |
| 141 | if( _type==t._type ) return xmeet(t); |
| 142 | // TypeNil vs TypeNil meet |
| 143 | if( this instanceof TypeNil ptr0 && t instanceof TypeNil ptr1 ) |
| 144 | return ptr0.nmeet(ptr1); |
| 145 | // Reverse; xmeet 2nd arg is never "is_simple" and never equal to "this". |
| 146 | if( is_simple() ) return this.xmeet(t ); |
| 147 | if( t.is_simple() ) return t .xmeet(this); |
| 148 | return Type.BOTTOM; // Mixing 2 unrelated types |
| 149 | } |
| 150 | |
| 151 | // Compute meet right now. Overridden in subclasses. |
| 152 | // Handle cases where 'this.is_simple()' and unequal to 't'. |