diku-dk / futhark

:boom::computer::boom: A data-parallel functional programming language
http://futhark-lang.org
ISC License
2.36k stars 165 forks source link

Distinct entry point types are generated for types that differ only in names of size arguments #2080

Closed athas closed 6 months ago

athas commented 6 months ago
-- ==
-- entry: bar
-- script input { foo 10 }

type bools [n] = #foo [n]bool

entry foo (n: i64) : {x:[n]bool,y:bool} = {x=replicate n true,y=false}
entry bar [m] (b: {x:[m]bool,y:bool}) : bool = b.y

This fails with:

Entry point: bar; dataset: foo 10i32:
Expected value of type: {x: [m]bool, y: bool}
But got value of type:  {x: [n]bool, y: bool}

We have some code that sanitises sizes when constructing opaque entry point types, but clearly it is incomplete.