-
Notifications
You must be signed in to change notification settings - Fork 643
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow more predictable type checking with totality assertions #3745
Comments
I think I would expect this, because you have a non terminating thing that you claim is total, so Idris has decided to trust you and evaluate it further. I guess it's aborting with some kind of fatal error? |
Yes, I agree that this can happen because of the unjustified Here, there is no need to use the definition of I have reported the issue because it is yet another facet of the issues that led to #3199: the type checker runs into a trouble because it tries to do more than it is actually needed. You can see that this is the case by deferring the implementation of
type checks in a breeze and the goal |
@nicolabotta I certainly think that you are right in that this is a greyzone, and I can relate to the unpredictability in behaviour. If it is OK, I will close this as expected behaviour, since it is a result of an assertion and I am unsure whether there is a good way to account for them. If you or Edwin believe that the issue is important, please reopen it. |
Ahmad, I believe that the issue should be re-opened. It is true that the behavior is triggered by an unjustified assertion, but this is not the point. The point here is that the type checker gets stuck in performing operations that are not actually needed to type check the code. This can be demonstarted by deferring the point of definition of This is a fundamental deficiency of the type checker which was originally planned to be addressed with 1.0. Some weeks ago Edwin realized that type checking using whnf was not going to be a viable approach, see #3199. The reported issue is just an instance of #3199 like #3246, #3358 and, I believe, #172! |
As you wish, I have reopened the issue. I unfortunately do not know enough about the intrinsics of the type checker to know how it should optimally be resolved. |
@ahmadsalim Thanks Ahmad, I have of course no idea how the issue could be addressed but it seems counterintuitive that a code that type checks for every |
The program
type checks fine and almost immediately. But uncommenting the last line, type checking aborts after about 30 minutes.
I understand that this is due to the unjustified
assert_total
inval
but still I am not sure that this is the expected behavior.The text was updated successfully, but these errors were encountered: