[GHC] #9636: Function with type error accepted