inconsistent type checking behavior