class A pass class B inherits A pass class C inherits A pass class P def main .testHeterogeneousAssignment .testHeterogeneousInference def testHeterogeneousAssignment b = B() c = C() b, c = B(), C() CobraCore.noOp(b, c) def testHeterogeneousInference b, c = B(), C() if b inherits A # .warning. The expression is always of type "A" pass if c inherits A # .warning. The expression is always of type "A" pass if b inherits B # .warning. The expression is always of type "B" pass if c inherits C # .warning. The expression is always of type "C" pass