Compiler confusing property name with effect function name
jameswoodleybetenbough opened this issue · comments
Expected: When an effect function and a type property have the same name, then the compiler can correctly resolve the function name in the effect handler definition.
Actual: The compiler is unable to discern that the name refers to an effect function handler definition and not the property name of a type. Furthermore, the effect function name is unable to be qualified in any way (that I can think of) that would resolve the issue.
type foo
Foo
bar: string
effect some-effect
fun bar(name: string) : foo
fun main()
with handler
fun bar(name) Foo(bar=name)
^^^
// error: identifier bar cannot be resolved.
// context : bar(name)
// inferred type: (_) -> _
// candidates : bar : (name : string) -> some-effect foo
// foo/bar: (foo : foo) -> string
// hint : give a type annotation or qualify the name?
()
Sorry I was signed in under the wrong account when I created the issue.
We should at minimum qualify the some-effect/bar
name, but in handlers we should only consider names that are defined as effect clauses.