backport from https://github.com/lampepfl/dotty/pull/5754 See also deprecation of package object with extends in #441