I wonder if the type of the alternation function is wrong. I tried something similar and the compiler reported that the covariant type parameter T is used in a contravariant position. I tried def | [U >: T]( q: => Parser[U]) = new Parser[U] ...
Copyright © 2024 Artima, Inc. All rights reserved.