Skip to content

Type error in parametrized interface. #1875

@ghost

Description

The following setup:

interface State[S, I, O]
    fun val apply(state: S, input: I): (S, O)
    fun val bind[O2](next: State[S, O, O2]): State[S, I, O2]

doesn't typecheck. The compiler complains that

type argument is outside its constraint
argument: O #any
constraint: O2 #any
O #any is not a subtype of O2

Aliasing O to some other name or replacing it with any of the other types in the bind definition makes it compile.

I'm running ponyc v0.13.1 on Arch Linux.

Metadata

Metadata

Assignees

Labels

needs investigationThis needs to be looked into before its "ready for work"

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions