dhall-lang / dhall-to-cabal

Compile Dhall expressions to Cabal files
MIT License
100 stars 19 forks source link

Fix a potential correctness bug in CSE manipulation. #157

Closed quasicomputational closed 5 years ago

quasicomputational commented 5 years ago

Previously, we'd unconditionally try to substitute in or bind the variable, but this could go wrong as we only shift in the case where CSE lifted out a subexpression. Concretely, imagine trying to lift Library out of this expression:

let Library = 2 in Library

This is a theoretical problem at present, as none of the expressions being operated on actually look like that. But it's still a potential landmine, so it's worth fixing for the future.