forked from zio/zio-schema
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Scala 3 support (including DeriveSchema) (zio#243)
* scala 3 macros WIP * derive case classes * derive enums * get annotations for case classes * handle recursion * reorganize test * recursive enums * formatting * fixes * remove trait organization to fix dotty compilation * fix build * fix build
- Loading branch information
1 parent
0ed75b2
commit 08eabea
Showing
60 changed files
with
3,584 additions
and
444 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,7 +33,7 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
java: ['[email protected]', '[email protected]'] | ||
scala: ['2.12.15', '2.13.6'] | ||
scala: ['2.12.15', '2.13.8', '3.1.1'] | ||
steps: | ||
- uses: actions/[email protected] | ||
- uses: olafurpg/setup-scala@v13 | ||
|
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
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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
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
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
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
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
38 changes: 38 additions & 0 deletions
38
zio-schema-derivation/shared/src/main/scala-3/zio/schema/Person.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,38 @@ | ||
package zio.schema | ||
|
||
import scala.annotation.StaticAnnotation | ||
|
||
enum Color { | ||
case Red | ||
case Green | ||
case Blue | ||
} | ||
|
||
case class name(string: String) extends StaticAnnotation | ||
|
||
case class PersonId(int: Int) | ||
|
||
@name("kit") | ||
case class Person( | ||
id: PersonId, | ||
@name("wow") | ||
@name("name field") | ||
name: String, | ||
@name("person age") | ||
age: Int, | ||
isAlive: Boolean, | ||
friends: List[Person] | ||
) | ||
|
||
case class Address( | ||
street: String, | ||
city: String, | ||
state: String, | ||
zip: Int | ||
) | ||
|
||
case class PersonWithAddress( | ||
person: Person, | ||
address: Address, | ||
meta: Int | ||
) |
Oops, something went wrong.