Closed
Description
This will hang or crash the compiler. I'm trying to describe a "pipe" behavior, which an implementing class can fulfill by using its constructor. It'll end up being similar to flatMap, etc.
class Foo<T>{
public function new() { }
public function pipe<A>(f : T->Pipeable<A>){
// don't even use the function argument for this example.
var ret = new Foo<A>();
return ret;
}
static function main(){
var f = new Foo();
f.pipe(function(x) return new Foo());
}
}
typedef Pipeable<T> = {
function pipe<A>(f : T->Pipeable<A>) : Pipeable<A>;
}
Activity