-
Notifications
You must be signed in to change notification settings - Fork 77
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
False positive: addition and subtraction on datetime values #1603
Comments
Oops, you are completely right: two missing cases. Thanks! |
Solving this in the type checker is trivial (have already fixed it). For the compiler I have to study this a bit more: to my surprise |
I should have checked, but it seems that only subtraction is allowed in the interpreter..
|
|
Indeed! This means that I will have to port that code to the runtime of the compiler. |
Unfortunately yes; this part of the DateTime API is waiting patiently on the introduction of "units and dimensions" in vallang and Rascal, such that |
When we have that, the code can move into |
Fair enough, let's not go into this rat hole for now :-) |
As part of this rewriting I came across very strange stuff around datetimes. For example there want is also a datetime library, that also has a duration adt. |
Yes, way back when we decided that a Duration ADT was a bridge too far for the |
That is what confused me, it's the inverse, the see: rascal/src/org/rascalmpl/interpreter/result/DateTimeResult.java Lines 368 to 377 in d110baf
and: rascal/src/org/rascalmpl/library/Prelude.java Lines 420 to 425 in d110baf
|
thanks for the references. that's exactly right. let's leave it for now until we have the dimensions. otherwise, we'd have yet another breaking change in the library and language when we introduce that. |
True, I would be surprised if many people use this feature, but I agree to leave it as is. |
Describe the bug
The type checker flags addition and subtraction on
datetime
values as errors.To Reproduce
Screenshots
The text was updated successfully, but these errors were encountered: