Skip to content

anytype fields cannot be initiated to array or struct literals #5877

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

Closed
Vexu opened this issue Jul 15, 2020 · 1 comment
Closed

anytype fields cannot be initiated to array or struct literals #5877

Vexu opened this issue Jul 15, 2020 · 1 comment
Labels
bug Observed behavior contradicts documented or intended behavior stage1 The process of building from source via WebAssembly and the C backend.
Milestone

Comments

@Vexu
Copy link
Member

Vexu commented Jul 15, 2020

const S = struct {
    foo: anytype,
};
comptime {
    var s = S{
        // error: array access of non-array type '(anytype)'
        .foo = [2]u8{0,1},
    };
    // this works
    // var s = S{
    //     .foo = 1,
    // };
    // var b = [2]u8{ 0, 1 };
    // s.foo = b;
}
@Vexu Vexu added bug Observed behavior contradicts documented or intended behavior stage1 The process of building from source via WebAssembly and the C backend. labels Jul 15, 2020
@Vexu Vexu added this to the 0.7.0 milestone Jul 15, 2020
@andrewrk andrewrk modified the milestones: 0.7.0, 0.8.0 Aug 13, 2020
@andrewrk andrewrk modified the milestones: 0.8.0, 0.9.0 Nov 6, 2020
@andrewrk andrewrk modified the milestones: 0.9.0, 0.10.0 May 19, 2021
@ifreund
Copy link
Member

ifreund commented May 30, 2022

anytype fields have been removed from the language.

@ifreund ifreund closed this as completed May 30, 2022
@Vexu Vexu modified the milestones: 0.12.0, 0.10.0 Jun 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Observed behavior contradicts documented or intended behavior stage1 The process of building from source via WebAssembly and the C backend.
Projects
None yet
Development

No branches or pull requests

3 participants