-
Notifications
You must be signed in to change notification settings - Fork 8
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
Can the type checker generate a more helpful error here? #437
Comments
I'm afraid not, there is no way for me to determine the type of |
I am flabbergasted. In the rule Then, the generated error message talks about an ambituity with some |
Stating If I look at the rule, I could formulate something completely different: The conclusion is that there is an error in the script. This leaves us with two alternatives for this issue. We could either close it, or leave it open. In both cases, nothing will be changed at the error message level. Leaving it open only causes this issue to appear on the backlog, knowing that nothing will be done for it ever. |
I agree that the type checker does a great job in finding all errors. The next thing is that it should point the user in a right direction. If I follow the advise of the error message, the error is not solved. Therefore, the errormessage is wrong. I disagree with anybody that insists that it is acceptable that tools provide guidance for solving an error that, when followed, does not solve that error. If nothing is done about that, then we should be continuously reminded of this. Therefore, I reopen this ticket. |
@RieksJ suggests that it is possible that in all cases a single message could give guidence that is well enough to solve an error. The current implementation cannot do that. In cases like this, where there is a combination of mistakes in the script, i doubt that it is possible at all. To do an execellent job in such cases, one must know that no guidence can be generated. However, the current implementation cannot do so either. As long as no one has any clue about how to implement this wish, no progress can be made at all for this issue. As each open issue has a maintenance cost, I suggest to close it. |
What I suggested is that if an error message provides guidance in some case, such guidance should actually help to solve the problem rather than sending users into the wrong way. The error message I mentioned sent me into the wrong way. For me, I can live with the way it is (even if it irritates me at some point). However, for students and other &-apprentices meaningful, i.e. helpful error messages seem quite important to me. I suggest @stefjoosten to decide whether to close this ticket or do something about it. |
I had the same discussion with @sjcjoosten in the past. In my recollection they were as fiercly debated as above. I'm still not sure what causes the confusion. But now I have a hunch... edit by sjcjoosten: this hunch has been moved to #688 |
The error message that was provided only points to one error, where there are more. The suggestions point to the 'wrong' direction (from a user point of view) because none of them will result in the rule becoming correct. Would it be possible to check the suggestions of the type-checker to see if either/any of them makes sense (i.e. would actually result in a type-correct RULE rather than some non-obvious partial expression), and if not, it might provide a more general kind of instruction for fixing the issues, which in this case might be something like:
Whatsay? |
This makes a lot of sense and sounds like a great idea to me. I might be able to detect that the 'Cannot disambiguate' arises because of a type error that I can't yet point at exactly. How would this be as an error:
In case there is an ISA between the two (or more) concepts, we could write (in place of |
This error message suggestion of @sjcjoosten considers the possibility that there is no signature that would produce a correct expression, which is an improvement over the current situation (and likely a very quick fix!). However, helping the modeler consists of being as precise as can be. Therefore, I would like to see different messages for the case where adding a signature would result in a type-correct rule (preferably with suggestions for all concepts that would actually produce a type-correct rule) and the case where no concept exists that, when added as a signature, would produce a type-correct rule. For the first category, the current message suffices. For the latter category, I would suggest something like
And while this message may not yet be ideal, I do consider it an improvement over @sjcjoosten's suggestion. |
I want to avoid writing `there is no way', as there might be one, it's just that I cannot (within reasonable performance) find it if it exists. Also, I have no idea what to put on the On the second part of your message: I would not change the message if adding a signature is likely to result in a type-correct rule. |
Ok. How about:
|
Great, I can definitely do that (except I won't be sure whether this occurs in a rule or not), and maybe I can do better, tell me what you think:
|
Having given it some thought, I am not convinced that the line Perhaps this might be an improvement (where the second line in the message sums up the concepts that appear in the expression, and fail to make the expression type-correct):
|
This issue is stale because it has been open 5 years with no activity. Remove stale label or comment or this will be closed in 30 days. |
This issue was closed because it has been stalled for 30 days with no activity. |
I used Ampersand v3.5.1[development:28036cb] to compile
This resulted in the following output:
Note that
line 10:51
refers to theI
inI-asmValue;asmValue~
.After spending quite some time, I discovered that
RULE "two"
does not match at the very end, i.e. the target concept of the expressionI-asmValue;asmValue~
does not match the target concept of the left hand side of the rule.@sjcjoosten: can you arrange an error message that is more helpful (e.g. that points this out) rather than the (unhelpful, albeit like correct) message that asserts a disambiguity in
I
?The text was updated successfully, but these errors were encountered: