You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/match-types-spec.md
+9-5Lines changed: 9 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -270,10 +270,13 @@ At the top level, `variance = 1` and `scrutIsWidenedAbstract = false`.
270
270
* If `T` is a refined type of the form `Base { type Y = ti }`:
271
271
* Let `q` be `X` if `X` is a stable type, or the skolem type `∃α:X` otherwise.
272
272
* If `q` does not have a type member `Y`, fail as not matching (that implies that `X <:< Base` is false, because `Base` must have a type member `Y` for the pattern to be legal).
273
-
* If `q.Y` is abstract or is a class definition, fail as not specific.
274
-
* Otherwise, the underlying type definition of `q.Y` is of the form `= U`.
275
-
* If `q` is a skolem type `∃α:X` and `U` refers to `α`, fail as not specific.
276
-
* Compute `matchPattern(t, U, 0, scrutIsWidenedAbstract)`.
273
+
* If `q.Y` is abstract, fail as not specific.
274
+
* If `q.Y` is a class member:
275
+
* If `q` is a skolem type `∃α:X`, fail as not specific.
@@ -303,6 +306,7 @@ These can be categorized as follows:
303
306
* 2 libraries with 1 type member extractor each where the `Base` does not contain `Y`; they are both to extract `SomeEnumClass#Value` (from Scala 2 `scala.Enumeration`-based "enums").
* the maintainers of `json4s` already accepted a PR with a workaround at https://github.com/json4s/json4s/pull/1347
306
310
* 1 library used to have 2 cases of the form `case HKExtractor[f] =>` with `type KHExtractor[f[_, _]] = Base { type Y[a, b] = f[a, b] }`.
307
311
* Those used to be at https://github.com/7mind/idealingua-v1/blob/48d35d53ce1c517f9f0d5341871e48749644c105/idealingua-v1/idealingua-v1-runtime-rpc-http4s/src/main/scala-3/izumi/idealingua/runtime/rpc/http4s/package.scala#L10-L15 but they do not exist in the latest version of the library.
308
312
* 1 library used to have 1 `&`-type extractor (which "worked" who knows how?):
@@ -314,7 +318,7 @@ These can be categorized as follows:
314
318
defined at https://github.com/kory33/s2mc-test/blob/d27c6e85ad292f8a96d7d51af7ddc87518915149/protocol-core/src/main/scala/io/github/kory33/s2mctest/core/generic/compiletime/Generic.scala#L12
315
319
It could be replaced by a concrete `class Lock[A](phantom: A)` instead.
316
320
317
-
The only case for which there exists no workaround that we know of is the extractor for `scala.Enumeration`-based `Value` classes.
321
+
All the existing use cases therefore have either already disappeared or have a workaround.
0 commit comments