effekt icon indicating copy to clipboard operation
effekt copied to clipboard

Effectful signatures are not implemented for objects

Open b-studios opened this issue 1 year ago • 0 comments

It looks like we forgot to implement capability passing for the new object feature:

effect Exc(): Unit

interface MyClass {
  def get(): Int / { Exc }
}

def impl = new MyClass {
  def get() = { do Exc(); 42 }
}

The same mechanism does already work for bidirectional effects:

effect Exc(): Unit

interface MyClass {
  def get(): Int / { Exc }
}

def impl() = 
  try { o.get() } 
  with o: MyClass {
    def get() = { resume { do Exc(); 42 } }
  }
  with Exc { 0 }

we simply forgot to implement it for objects.

@jiribenes this is related to what we discussed before (#148).

b-studios avatar Sep 26 '22 10:09 b-studios