Add extra type.isa<FloatType>() check to FloatAttr::get(Type, double) method.
Otherwise it tries to call type.cast<FloatType>(), which fails with assertion in Debug mode.
The !type.isa<FloatType>() case just redirercts the call to FloatAttr::get(Type, APFloat),
which will perform the actual check and emit appropriate error.