f x y = typecase x of Int -> i + y other -> 0
The function can have either of these two types (among others):
a -> Int -> Int
a -> a -> Int
Neither is more general, so there is no principal type.
Unless the user tells us something (in a type annotation) we have no way of deciding which type should be inferred.
So for now, Infernu will probably not have support for type guards like Flow and TypeScript do (both of which don’t have full type inference). Another possibility is to allow type guards in trivial cases only.