You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
objectTest {
sealedtraitParser[I]
implicitclassParserOps[I](valparser:Parser[I]) extendsAnyVal {
deftrans(pf: PartialFunction[Parser[I], Parser[I]]):Parser[I] = {
parser
}
defwithErrorValue(errorValue: =>Parser[I]):Parser[I] = parser trans {
case p => p
}
}
}
The error is:
overriding method applyOrElse in traitPartialFunction of type [A1<: eu.swdev.parser.push.Test.Parser[I], B1>: eu.swdev.parser.push.Test.Parser[I]](x: A1, default: A1=>B1)B1;
method applyOrElse has incompatible typedefwithErrorValue(errorValue: =>Parser[I]):Parser[I] = parser trans {
objectcreation impossible, since method isDefinedAt in traitPartialFunction of type (x: eu.swdev.parser.push.Test.Parser[I])Boolean is not defined
(Note that A does not match eu.swdev.parser.push.Test.Parser[I])
defwithErrorValue(errorValue: =>Parser[I]):Parser[I] = parser trans {
^ ^
The compilation error disappears if
the ParserOps class is changed such that it does not extend AnyVal or
the type parameter I is removed from the Parser class
The text was updated successfully, but these errors were encountered:
This code does not compile:
The error is:
The compilation error disappears if
ParserOps
class is changed such that it does not extendAnyVal
orI
is removed from theParser
classThe text was updated successfully, but these errors were encountered: