-
Notifications
You must be signed in to change notification settings - Fork 131
Add Scala 3 CanEqual for Parsers.~ to support strict equality #646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
92dad84
00851d8
0840ffa
890dc4a
5e80a57
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Large diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| /* | ||
| * Scala (https://www.scala-lang.org) | ||
| * | ||
| * Copyright EPFL and Lightbend, Inc. dba Akka | ||
| * | ||
| * Licensed under Apache License 2.0 | ||
| * (http://www.apache.org/licenses/LICENSE-2.0). | ||
| * | ||
| * See the NOTICE file distributed with this work for | ||
| * additional information regarding copyright ownership. | ||
| */ | ||
|
|
||
| package scala.util.parsing.input | ||
|
|
||
| private[input] trait ScalaVersionSpecificPagedSeq[T] { | ||
| self: PagedSeq[T] => | ||
| // Members declared in scala.collection.Seq | ||
| override def iterableFactory: collection.SeqFactory[collection.IndexedSeq] = collection.IndexedSeq | ||
|
|
||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| /* | ||
| * Scala (https://www.scala-lang.org) | ||
| * | ||
| * Copyright EPFL and Lightbend, Inc. dba Akka | ||
| * | ||
| * Licensed under Apache License 2.0 | ||
| * (http://www.apache.org/licenses/LICENSE-2.0). | ||
| * | ||
| * See the NOTICE file distributed with this work for | ||
| * additional information regarding copyright ownership. | ||
| */ | ||
|
|
||
| package scala.util.parsing.combinator | ||
|
|
||
| import scala.language.strictEquality | ||
| import scala.util.parsing.combinator.RegexParsers | ||
|
|
||
| class CanEqualsCompileTest extends RegexParsers { | ||
| val x: String ~ String = new~("a", "b") | ||
| val y: String ~ String = new~("a", "b") | ||
| x == y | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I admit to having been puzzled by #477, and this test isn't helping me understand it 477 says:
this doesn't sound like a description of what you've done here in the test...?
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe @klaeufer is around to add some clarification? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sorry, was teaching last night...thanks for looking into this issue. Looks like my example evolved, and the URL I had included is no longer valid. Without providing def expr: Parser[Expr] =
term ~! opt(("+" | "-") ~ term) ^^ {
case l ~ None => l
case l ~ Some("+" ~ r) => Plus(l, r)
case l ~ Some("-" ~ r) => Minus(l, r)
}The original source is here. Let me know if there is anything else I should clarify. |
||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.