silver icon indicating copy to clipboard operation
silver copied to clipboard

Another Decoration Inference Bug

Open remexre opened this issue 4 years ago • 2 comments

Copied from Slack:

https://git.sr.ht/~remexre/exps/tree/bd8fcfb96eaeacd53faae72ad889a0d7b9ec2033/item/ableC-ssa/src/xyz.remexre.ssa/SSA.sv.md?view-source#L262 gets a type error,

Case.sv:1073:8: error: Then and else branch must have the same type. Instead they are silver:core:Maybe<(Decorated xyz:remexre:ssa:BasicBlock with {xyz:remexre:ssa:func}, Decorated xyz:remexre:ssa:Stmt with {})> and silver:core:Maybe<(Decorated xyz:remexre:ssa:BasicBlock with {xyz:remexre:ssa:func}, Decorated xyz:remexre:ssa:Stmt with {xyz:remexre:ssa:func})>
SSA.sv.md:259:2: error: Expected return type is silver:core:Maybe<(Decorated xyz:remexre:ssa:BasicBlock with {xyz:remexre:ssa:func}, Decorated xyz:remexre:ssa:Stmt with {xyz:remexre:ssa:func})>, but the expression has actual type silver:core:Maybe<(Decorated xyz:remexre:ssa:BasicBlock with {xyz:remexre:ssa:func}, Decorated xyz:remexre:ssa:Stmt with {})>

inaccurate location aside, is this right? shouldn't it be taking the h without redecorating it? (changing the when to an if results in no change)

Lucas adds:

I've been having trouble reproducing this as a simpler example, but I suspect a substitution threading issue somewhere (since unspecialized possibly-decorated types default to being decorated with the empty set.)

remexre avatar May 13 '21 00:05 remexre

https://git.sr.ht/~remexre/exps/commit/2c83de331a75a39f24727eed957576392f39312a is indeed a workaround.

remexre avatar May 13 '21 17:05 remexre

Possible duplicate of #502.

krame505 avatar Sep 22 '21 22:09 krame505