Skip to content

Identifier conflict with named effects #739

@HeikoRibberink

Description

@HeikoRibberink

The following:

pub named effect iter<a>
  fun next() : a
  
pub fun repeat(elem : a) : _ ev<iter<a>>
  with h <- named handler
    fun next()
      elem
  h

fails to compile with

iterator.kk(8, 9): type error: identifier next cannot be resolved.
  context      :         next()
  inferred type: (_) -> _
  candidates   : next       : forall<a> (hnd/ev<iter<a>>) -> <div,exn> a
                 sslice/next: (slice : sslice/sslice) -> maybe<(char, sslice/sslice)>
  hint         : give a type annotation or qualify the name?

Even though I would expect it to compile just fine, as it is absolutely clear to the compiler what the types are.
This behaviour only happens with named handlers in my tests.
If this is not a bug, then this behaviour would severely limit the usability of named handlers.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions