Skip to content

Declaration "class MyParser[A] extends RegexParsers with PackratParsers" does not compile #398

Open
@oreshkor

Description

@oreshkor

I wish to declare concrete class with a type parameter but scala compiler does not allow to do this if it extends both traits RegexParsers and PackratParsers simultaneously.
Compilation error says:

illegal trait super target found for method phrase required by trait PackratParsers;
[error]  found   : override def phrase: ([T](p: _1.Parser[T]): _1.Parser[T])( forSome { val _1: [A]MyParser[A] }) in trait RegexParsers;
[error]  expected: def phrase: ([T](p: _1.Parser[T]): _1.Parser[T])( forSome { val _1: [A]MyParser[A] }) in trait Parsers

Is there any way how to bypass this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions