halotukozak.alpaca.internal.withDefault
See thewithDefault companion object
Emulates a default type argument, which Scala 3 doesn't have.
lexer and Parser take a using Ctx withDefault D clause, so lexer { ... } and extends Parser without a type argument infer Ctx = D, while an explicit [MyCtx] keeps MyCtx. The given is always found by the compiler; this is an implementation detail and never needs to be written or provided by users.
Type parameters
- Fallback
-
the default type
- Provided
-
the provided type
Attributes
- Companion
- object
- Source
- WithDefault.scala
- Graph
-
- Supertypes
-
class Objecttrait Matchableclass Any
In this article
