Skip to content

Instantly share code, notes, and snippets.

@bishabosha
Created January 23, 2020 13:40
Show Gist options
  • Save bishabosha/48b96a7b8a023007ec3b050ac4db1f1c to your computer and use it in GitHub Desktop.
Save bishabosha/48b96a7b8a023007ec3b050ac4db1f1c to your computer and use it in GitHub Desktop.
Migrating package objects with extends clauses

Here is a trait in package p

package p
trait Aliases { type Env = A with B }

In Scala 2, you could do this:

package object p extends Aliases

In Scala 3.1 and beyond, you will have to do this

package p

private object AliasesLive extends Aliases
export AliasesLive._
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment