MCPcopy Create free account
hub / github.com/SeaOfNodes/Simple / xmeet

Method xmeet

chapter16/src/main/java/com/seaofnodes/simple/type/Type.java:145–154  ·  view source on GitHub ↗
(Type t)

Source from the content-addressed store, hash-verified

143 // Handle cases where 'this.is_simple()' and unequal to 't'.
144 // Subclassed xmeet calls can assert that '!t.is_simple()'.
145 Type xmeet(Type t) {
146 assert is_simple(); // Should be overridden in subclass
147 // ANY meet anything is thing; thing meet ALL is ALL
148 if( _type==TBOT || t._type==TTOP ) return this;
149 if( _type==TTOP || t._type==TBOT ) return t;
150 // 'this' is {TCTRL,TXCTRL}
151 if( !t.is_simple() ) return BOTTOM;
152 // 't' is {TCTRL,TXCTRL}
153 return _type==TCTRL || t._type==TCTRL ? CONTROL : XCONTROL;
154 }
155
156 public Type dual() {
157 return switch( _type ) {

Callers 1

meetMethod · 0.95

Calls 1

is_simpleMethod · 0.95

Tested by

no test coverage detected