-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Open
Labels
breakingImplementing this issue could cause existing code to no longer compile or have different behavior.Implementing this issue could cause existing code to no longer compile or have different behavior.proposalThis issue suggests modifications. If it also has the "accepted" label then it is planned.This issue suggests modifications. If it also has the "accepted" label then it is planned.
Milestone
Description
The following are semantically equivalent:
const a = T{};
const a: T = .{};
const a = @as(T, .{});I propose to remove the first possibility, and rely on the other two.
The problem with this proposal as I can see it is inferred-size array literals:
const a = [_]u8{1, 2, 3};There's no other way to write this. And if that works, then why wouldn't this work?
const a = [3]u8{1, 2, 3};But now we're back to the proposal:
const a = [3]u8{1, 2, 3};
const a: [3]u8 = .{1, 2, 3};
const a = @as([3]u8, .{1, 2, 3});mogud, tadeokondrak, foobles, hamad-almamari, tauoverpi and 32 morereo101, misanthrop, trgwii, Jarred-Sumner, ypyf and 35 moreseptemhillmarler8997, Rvrzng, Hadron67, seandewar and OSuwaidi
Metadata
Metadata
Assignees
Labels
breakingImplementing this issue could cause existing code to no longer compile or have different behavior.Implementing this issue could cause existing code to no longer compile or have different behavior.proposalThis issue suggests modifications. If it also has the "accepted" label then it is planned.This issue suggests modifications. If it also has the "accepted" label then it is planned.