scala.quoted.runtime.QuoteMatching.ExprMatchModule
Members listPattern matches an the scrutineeExpr against the patternExpr and returns a tuple with the matched holes if successful.
Pattern matches an the scrutineeExpr against the patternExpr and returns a tuple with the matched holes if successful.
Examples:
ExprMatch.unapply('{ f(0, myInt) })('{ f(0, myInt) }, _)
will return Some(())
(where ()
is a tuple of arity 0)ExprMatch.unapply('{ f(0, myInt) })('{ f(patternHole[Int], patternHole[Int]) }, _)
will return Some(Tuple2('{0}, '{ myInt }))
ExprMatch.unapply('{ f(0, "abc") })('{ f(0, patternHole[Int]) }, _)
will return None
due to the mismatch of types in the holeHoles:
x
of type Expr[U]
if U <:< T
and returns x
as part of the match.Expr[Any]
containing the pattern tree
Expr[Any]
on which we are pattern matching
None if it did not match, Some(tup)
if it matched where tup
contains `Expr[Ti]``
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4