-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[codegen] add scala 3 keywords to collision avoidance (#1392)
* [codegen] add scala 3 keywords to collision avoidance * testfix * fmt * Add changelog entry * remove scala 3 soft keywords * add scala3 reserved keywords to sample specs * remove redundant unit test --------- Co-authored-by: David Francoeur <[email protected]>
- Loading branch information
1 parent
575136f
commit cddd682
Showing
4 changed files
with
39 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
modules/bootstrapped/src/generated/smithy4s/example/collision/Scala3ReservedKeywords.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package smithy4s.example.collision | ||
|
||
import smithy4s.Hints | ||
import smithy4s.Schema | ||
import smithy4s.ShapeId | ||
import smithy4s.ShapeTag | ||
import smithy4s.schema.Schema.struct | ||
|
||
final case class Scala3ReservedKeywords(_export: Option[String] = None, _enum: Option[String] = None) | ||
|
||
object Scala3ReservedKeywords extends ShapeTag.Companion[Scala3ReservedKeywords] { | ||
val id: ShapeId = ShapeId("smithy4s.example.collision", "Scala3ReservedKeywords") | ||
|
||
val hints: Hints = Hints.empty | ||
|
||
implicit val schema: Schema[Scala3ReservedKeywords] = struct( | ||
String.schema.optional[Scala3ReservedKeywords]("export", _._export), | ||
String.schema.optional[Scala3ReservedKeywords]("enum", _._enum), | ||
){ | ||
Scala3ReservedKeywords.apply | ||
}.withId(id).addHints(hints) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters