You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Setup, a generic type and a few helper nodes
type Gen(Element: @Type)
type Normal
node del(
value!: Normal
------
)
node normal(
------
value!: Normal,
)
node passGen(
valueIn!: Gen('A)
------
valueOut: Gen('A)
)
// As a node, typechecks perfectly:
node testNode(
paramGen: Gen(Normal),
paramNormal!: Normal
------
out: Gen(Normal),
)
rule testNode(paramGen, paramNormal!, out) normal(value!) {
let paramNormal = normal()
del(paramNormal)
let variable = passGen(paramGen)
@connect(variable, out)
}
// As a function, fails to typecheck: (observe that the types and body are the same; the node just needs a few extra wrapper lines)
function testFunction(paramGen: Gen(Normal), paramNormal: Normal): Gen(Normal) {
del(paramNormal) // <- I fail to unify types -- left: Normal | right: Normal Gen
let variable = passGen(paramGen)
return variable
}
Reproduction:
Link to playground
The text was updated successfully, but these errors were encountered: