Lennart Spitzner
Lennart Spitzner
In lines 24-29 (`mkIEVarFromNameT`) you reuse the same unique loc, which means that there is one AnnKey shared between `IEVar`, `IEName` and `Unqual`. As a consequence, in line 111 you...
Or written in imperative style, your code roughly reads as ~~~~ 024 loc1 = loc2 = loc3 = generateUnique(); 110 myAnnMap[loc1].annsDP = myMap[loc1].annsDP ++ [comma]; 111 myAnnMap[loc2] = { dp...
Oh, right. Try refactoring the code so that you only do one `runTransform`. The return value from `uniqueSrcSpanT` is only as unique as the state of the `Transform`, and every...
Although you only have 2 `runTransforms`, I thought you had more. Maybe try testing this hypothesis by using `runTransformFrom n` in line 117.
If that works you can refactor the code to clean it up. It should be a bit cleaner with a single runTransform on the outside.
hm no, you don't use `uniqueSrcSpanT` in the second `runTransform`. But I don't trust yet that you don't have overlapping keys nonetheless. Maybe the whole `addExports` should be a monadic...
I recommend to `Debug.Trace.trace` the involved keys/locs to diagnose this. `astLoc` in line 98 and `loc` in 27 might still be the same.
oh, that is good to know. So I was wrong about the "overlapping keys" idea. The difference is just `addTrailingCommaT` vs `addSimpleAnnT` - the former does _not_ add an annotation...
That looks good. I just noticed that the AnnKeys are different if they are on different constructors. So because you have a `IEVar`, a `IEName` and an `Unqual` you should...
I don't see how my encoding would not be able to nest, indent, etc. But you certainly have a better picture of the many special cases around this stuff. But...