-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
proposal: remove the <<|
operator
#19635
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
Comments
its been brought to my attention the second point was unnecessary because |
https://sourcegraph.com/search?q=context:global+lang:Zig+%3C%3C%7C&patternType=keyword&sm=0 only surfaces Zig itself and two outside cases that could use |
Never used it either. |
I don't have especially strong feelings for this operator, but I don't really see any big problems with it either.
If anything, my question would be why there isn't a matching |
Interestingly, the behavior for const std = @import("std");
test {
const a: i8 = comptime (@as(i8, 99) <<| @as(i8, 111));
var b_lhs: i8 = 99;
var b_rhs: i8 = 111;
_ = &b_lhs;
_ = &b_rhs;
const b: i8 = b_lhs <<| b_rhs;
try std.testing.expectEqual(a, b);
}
LLVM defines its |
Related: #7605 |
b
must be comptime-known or have a type with log2 number of bits asa
. this is not the case in<<|
and confusing to code readers and newcomers.>>|
to complement it and nearly no one has noticed.for these reasons I propose we remove it.
The text was updated successfully, but these errors were encountered: