-
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.
Minimalist attempt to reproduce scala 3 compile error
scala/scala3#18555 branch:
- Loading branch information
1 parent
76aa260
commit ae1f893
Showing
11 changed files
with
111 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,16 @@ | ||
### SBT template | ||
# Simple Build Tool | ||
# http://www.scala-sbt.org/release/docs/Getting-Started/Directories.html#configuring-version-control | ||
|
||
dist/* | ||
target/ | ||
lib_managed/ | ||
src_managed/ | ||
project/boot/ | ||
project/plugins/project/ | ||
.history | ||
.cache | ||
.lib/ | ||
|
||
.idea/ | ||
.bsp/ |
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 @@ | ||
version = 2.7.5 |
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,21 @@ | ||
val scala3 = "3.3.0-RC1-bin-20221214-6383025-NIGHTLY" | ||
lazy val `ReactiveMongo-Core` = project | ||
.in(file("core")) | ||
.settings( | ||
name := "ReactiveMongo-Core", | ||
description := "Example sbt project that compiles using Scala 3", | ||
version := "0.1.0", | ||
scalaVersion := scala3, | ||
scalacOptions ++= Seq("-deprecation"), | ||
) | ||
|
||
|
||
lazy val `ReactiveMongo` = project | ||
.in(file("driver")) | ||
.settings( | ||
name := "ReactiveMongo", | ||
description := "Example sbt project that compiles using Scala 3", | ||
version := "0.1.0", | ||
scalaVersion := scala3, | ||
scalacOptions ++= Seq("-deprecation"), | ||
).dependsOn(`ReactiveMongo-Core`) |
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,8 @@ | ||
package reactivemongo.api | ||
|
||
private[api] trait SerializationPackCompat { | ||
_: Singleton with SerializationPack => | ||
|
||
val IdentityWriter: Writer[Document] | ||
val IdentityReader: Reader[Document] | ||
} |
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,9 @@ | ||
package reactivemongo.api | ||
|
||
|
||
private[api] trait SerializationPackCompat { | ||
_self: Singleton with SerializationPack => | ||
|
||
lazy val IdentityWriter: Writer[Document] | ||
lazy val IdentityReader: Reader[Document] | ||
} |
10 changes: 10 additions & 0 deletions
10
core/src/main/scala/api/GenericCollectionWithCommands.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,10 @@ | ||
package reactivemongo.api | ||
|
||
|
||
trait SerializationPack extends SerializationPackCompat { | ||
self: Singleton => | ||
type Value | ||
type Document <: Value | ||
type Writer[A] | ||
type Reader[A] | ||
} |
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,5 @@ | ||
|
||
@main | ||
def Main(args: String*): Unit = { | ||
println("hello world") | ||
} |
13 changes: 13 additions & 0 deletions
13
driver/src/main/scala/api/GenericCollectionWithCommands.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,13 @@ | ||
package reactivemongo.api.collections | ||
|
||
import collections.GenericCollection | ||
import reactivemongo.api.SerializationPack | ||
|
||
|
||
|
||
|
||
|
||
trait GenericCollectionWithCommands[P <: SerializationPack] { | ||
self: GenericCollection[P] => | ||
|
||
} |
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,13 @@ | ||
package reactivemongo.api | ||
|
||
trait PackSupport[P <: SerializationPack] { | ||
|
||
/** | ||
* The serialization pack ([[https://javadoc.io/doc/org.reactivemongo/reactivemongo-bson-api_2.12/latest/index.html BSON]] by default). | ||
* | ||
* Used to resolve the types of values | ||
* (by default `BSONValue`, `BSONDocument`, ...), and the related typeclasses | ||
* (e.g. `BSONDocumentReader` ...). | ||
*/ | ||
val pack: P | ||
} |
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,14 @@ | ||
package collections | ||
|
||
import reactivemongo.api.PackSupport | ||
import reactivemongo.api.SerializationPack | ||
import reactivemongo.api.collections.GenericCollectionWithCommands | ||
|
||
trait GenericCollection[P <: SerializationPack] | ||
extends GenericCollectionWithCommands[P] | ||
with PackSupport[P] { | ||
self => | ||
private implicit def packIdentityWriter | ||
: pack.Writer[pack.Document] = | ||
pack.IdentityWriter | ||
} |
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 @@ | ||
sbt.version=1.9.4 |