[GHC] #8635: GHC optimisation flag ignored when importing a local module with derived type classes