Closed mortberg closed 7 years ago
Hi @mortberg, thanks for the quick response! We tried this out, but it looks like it typechecks the module before reporting the error... I think this means that if there are type errors in the module, these will prevent the reporting of the shadowing. Since this is a common case (errors caused by shadowing), it would be nice if this check could be performed earlier, or perhaps interleaved with the checking of a module.
What do you think?
Hmm, right. I was printing it earlier in the loop but this led to it disappearing out of my terminal when I loaded some big file so I moved it down. But actually I think it makes sense to print it as early as possible so that if typechecking fails one sees it.
I moved it up before calling the typechecker now
Note that I went for the fastest way to implement this, but maybe this is not the nicest way to do it. I think it would be better if the shadowing test would be done for each definitions as one checks it, however this is a bit more boring to implement as one has to traverse the environment (one could give a better error message if one does this as one would know the location of the definition that gets shadowed). I'm not sure how well my solution works for local definitions either... Anyway this is better than nothing and it leaves room for contributions. :)
Cool :) I think that this is certainly good enough to merge! Thanks, @mortberg
Great, thanks for making me fix this issue!
This resolves https://github.com/mortberg/cubicaltt/issues/43