forked from scala/scala3
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Tweaks to path checking and massage tests
Needed to make stdlib2-cc go through. There were two errors. One in LayListIterable required a type annotation and a tweak to markFree. The other in Vieew.scala required a cast, but this could be fixed with better handling of pattern matching. path-patmat-should-be-pos.scala is a minimization.
- Loading branch information
Showing
5 changed files
with
69 additions
and
18 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
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
26 changes: 26 additions & 0 deletions
26
tests/neg-custom-args/captures/path-patmat-should-be-pos.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,26 @@ | ||
class It[A] | ||
|
||
class Filter[A](val underlying: It[A]^, val p: A => Boolean) extends It[A] | ||
object Filter: | ||
def apply[A](underlying: It[A]^, p: A => Boolean): Filter[A]^{underlying, p} = | ||
underlying match | ||
case filter: Filter[A]^ => | ||
val x = new Filter(filter.underlying, a => filter.p(a) && p(a)) | ||
x: Filter[A]^{underlying, p} // error | ||
// !!! should work, it seems to be the case that the system does not recognize that | ||
// underlying and filter are aliases. | ||
|
||
// On the other hand, the following works: | ||
locally: | ||
val filter: underlying.type & Filter[A] = ??? | ||
val a: It[A]^{filter.underlying} = ??? | ||
val b: It[A]^{underlying} = a | ||
val x = new Filter(filter.underlying, a => filter.p(a) && p(a)) | ||
x: Filter[A]^{underlying, p} | ||
|
||
locally: | ||
val filter: underlying.type & Filter[A]^ = ??? | ||
val a: It[A]^{filter.underlying} = ??? | ||
val b: It[A]^{underlying} = a | ||
val x = new Filter(filter.underlying, a => filter.p(a) && p(a)) | ||
x: Filter[A]^{underlying, p} |