-
Notifications
You must be signed in to change notification settings - Fork 48
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
Implicit casting does compile without errors #20
Comments
hmm, this was intentional but I can see how it can be considered unexpected. can you argue the case for why it is important that the above code produce an error? |
When adding type annotations, the main reason probably would be to add security for the code. |
Also for addition it should be required to have the same type by default. You almost never would add together n-vectors of different grade. |
You make good points about the virtues of explicit casting. I need to investigate whether the templatizaion technique I employed would allow me to keep generic casting and lose implicit assignment. As for adding n-vectors of different grade, I'm not convinced by your last statement. For instance, in the case of a scalar + a bivector (e.g. simple rotor) it is quite useful to be able to specify the type as |
When assigning a type to another type without explicitely casting, I would expect errors, but there aren't.
For example here:
The text was updated successfully, but these errors were encountered: