Skip to content

Scala 2 "implicit" no longer supported with -source:future on Scala 3.7.3 #1852

@LeifW

Description

@LeifW

Scala 3.7.3 includes an item in its release notes:

Disallow Scala 2 implicits under -source:future scala/scala3#23472

E.g. the following Smithy definition:

use alloy#openEnum

union UnionA {
  stringValue: String
  intValue: Integer
}

@openEnum
enum EnumA {
  VALUE_1
}

Generates code with schema values declared using Scala 2 implicit syntax:

implicit val schema: Schema[EnumA] = enumeration(tag, values).withId(id).addHints(hints)
 implicit val schema: Schema[UnionA] = union(
    UnionA.StringValueCase.alt,
    UnionA.IntValueCase.alt,
  )

Which the compiler now rejects with: "implicit vals are no longer supported, use a given clause instead."

Another Scala 3 codegen nit: the generated smithy4s.Endpoint has a series of _ for the type param positions, which has been getting a deprecation warning for a while now: "_ is deprecated for wildcard arguments of types: use ? instead"

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