Skip to content

Incorrectly inferring types #19

@joshcox

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions