Skip to content

Commit 7577c29

Browse files
committed
Explicitly upcast intermediate result to aid program elaboration
See scala/scala3#18130 for context. We add an explicit type ascription to help the compiler infer contextual arguments.
1 parent 3448f28 commit 7577c29

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

core/src/main/scala/weaponregex/parser/ParserJVM.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ class ParserJVM private[parser] (pattern: String) extends Parser(pattern) {
8989
* `"[abc]"`
9090
*/
9191
override def charClass[A: P]: P[CharacterClass] =
92-
Indexed("[" ~ "^".!.? ~ (charClassIntersection.rep(exactly = 1) | classItem.rep(minCharClassItem)) ~ "]")
92+
Indexed("[" ~ "^".!.? ~ ((charClassIntersection.rep(exactly = 1): P[Seq[RegexTree]]) | classItem.rep(minCharClassItem)) ~ "]")
9393
.map { case (loc, (hat, nodes)) => CharacterClass(nodes, loc, isPositive = hat.isEmpty) }
9494

9595
/** Intermediate parsing rule for special construct tokens which can parse either `namedGroup`, `nonCapturingGroup`,

0 commit comments

Comments
 (0)