-
-
Notifications
You must be signed in to change notification settings - Fork 313
Closed
Labels
AcceptedAccepted RequestAccepted RequestEnhancement RequestNew feature or requestNew feature or request
Milestone
Description
Currently type-inference is not fully covered when using &&, as demonstrated in the below example:
macro test(ushort* x) {
return *x;
}
fn void main() {
assert(test(&&4) == 4);
}Compiling this gives:
3: }
4:
5: fn void main() {
6: assert(test(&&4) == 4);
^^^
Error: Implicitly casting 'int*' to 'ushort*' is not permitted, but you may do an explicit cast by placing '(ushort*)' before the expression.
Same goes for using anything that is not an int (uint, char, long, ...).
It would be a nice enhancement if inference could resolve it.
cbuttner
Metadata
Metadata
Assignees
Labels
AcceptedAccepted RequestAccepted RequestEnhancement RequestNew feature or requestNew feature or request