Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions fastparse/src-3/fastparse/internal/MacroInlineImpls.scala
Original file line number Diff line number Diff line change
Expand Up @@ -287,8 +287,8 @@ object MacroInlineImpls {
}
}

inline def eitherInline[T, V >: T](inline lhs0: ParsingRun[T])(inline other: ParsingRun[V])(ctx5: ParsingRun[Any])
: ParsingRun[V] = {
inline def eitherInline[T, V](inline lhs0: ParsingRun[T])(inline other: ParsingRun[V])(ctx5: ParsingRun[Any])
: ParsingRun[V | T] = {

val oldCut = ctx5.cut
ctx5.cut = false
Expand All @@ -299,8 +299,8 @@ object MacroInlineImpls {
val lhsAggregate = ctx5.aggregateMsgs
if (ctx5.isSuccess) {
ctx5.cut |= oldCut
ctx5.asInstanceOf[ParsingRun[V]]
} else if (ctx5.cut) ctx5.asInstanceOf[ParsingRun[V]]
ctx5.asInstanceOf[ParsingRun[V | T]]
} else if (ctx5.cut) ctx5.asInstanceOf[ParsingRun[V | T]]
else {
val verboseFailures = ctx5.verboseFailures

Expand All @@ -317,7 +317,7 @@ object MacroInlineImpls {
if (verboseFailures) {
ctx5.reportAggregateMsg(rhsMsg ::: lhsMsg, ctx5.aggregateMsgs ::: lhsAggregate)
}
ctx5.asInstanceOf[ParsingRun[V]]
ctx5.asInstanceOf[ParsingRun[V | T]]
}
}

Expand Down
2 changes: 1 addition & 1 deletion fastparse/src-3/fastparse/package.scala
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ package object fastparse extends fastparse.SharedPackageDefs {
* fails it backtracks and tries to pass the right-hand-side. Can be
* chained more than once to parse larger numbers of alternatives.
*/
inline def |[V >: T](inline other: P[V])(using ctx: P[Any]): P[V] =
inline def |[V](inline other: P[V])(using ctx: P[Any]): P[V | T] =
MacroInlineImpls.eitherInline[T, V](parse0)(other)(ctx)

/** Plain cut operator. Runs the parser, and if it succeeds, backtracking
Expand Down