Skip to content

Scala 3 Migration Follow up: Context Parameters #426

Open
@Mark1626

Description

@Mark1626

Context Parameters using Implicit Definitions implicit Scala 2, have been reworked in Scala 3 as Given Instances given. There is a decent amount of rewrite needed for migrating to Given Instances.

The official guide also mentions that Scala 3 allows the use of implicit, and that the rewrite can be done in a phased manner. https://www.scala-lang.org/blog/2024/01/23/migration-to-scala-3.html

You might be wondering about all the new concepts and changes. For example, what should be done about implicit splits or enums? You don’t have to rewrite everything right away. Here and there, you can keep using the implicit keyword instead of given and using. The same applies to enums: you can keep using ADTs in the form of sealed traits with case classes and refactor to the new enums later.

Further Reading

  1. https://docs.scala-lang.org/scala3/guides/migration/incompatibility-table.html
  2. https://docs.scala-lang.org/scala3/book/ca-context-parameters.html

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions