Skip to content

Compiler hang/stack overflow with "piped" typedefs #2315

Closed
@jdonaldson

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions