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

Method xmeet

chapter11/src/main/java/com/seaofnodes/simple/type/Type.java:138–147  ·  view source on GitHub ↗
(Type t)

Source from the content-addressed store, hash-verified

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

Callers 1

meetMethod · 0.95

Calls 1

is_simpleMethod · 0.95

Tested by

no test coverage detected