Type fold ( int opcode , List < Type > argtypes ) { int argCount = argtypes . length ( ) ; if ( argCount == 1 ) return fold1 ( opcode , argtypes . head ) ; else if ( argCount == 2 ) return fold2 ( opcode , argtypes . head , argtypes . tail . head ) ; else throw new AssertionError ( ) ; }
Fold binary or unary operation returning constant type reflecting the operations result . Return null if fold failed due to an arithmetic exception .