Skip to content

Incorrectly inferring types #19

Description

@joshcox

Reproducer:

fun createNStreams(n,s) {
  fun f (n) iterate x in s { if moduloI(x,n) == 0 then emit x };
  fun g (n) if n == 1 then [] else f(n):::g(n-1);
  g(n)
}

The inferred type of this function is:
createNStreams :: (#a, Stream Int) -> List 'b;

This bug can be sidestepped by providing a correct type signature. The compiler accepts the correct type signature provided. For this particular function:
createNStreams :: (Int, Stream Int) -> List (Stream Int);

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions