Skip to content

extension function syntax should work on block types too #1186

@kyay10

Description

@kyay10

In Effekt, you can call a function and provide its first value parameter before the dot:

record bar(a: Int)
def bar2(b: bar) = println(b.a)
def main() = {
  bar(42).bar2()
}

but the same thing doesn't work for block arguments:

effect bar(): Int
def bar2{b: bar} = println(b.bar())
def main() = try {
  b.bar2() // Expected a value, but b is a computation. Use `box b` to pass it as a value instead
} with b: bar { 42 }

(that error message should be improved in the meantime)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions