no generic function downcast

Swift compiler crashes on a generic function downcast. A bugreport was
submitted to apple