Skip to content

Peer type resolution: S and ??S should produce ??S #2273

Open
@FnControlOption

Description

@FnControlOption

For example:

const std = @import("std");

const S = struct { i: i32 };

pub fn main() void {
    var runtime_bool: bool = true;
    _ = &runtime_bool;

    const foo: S = .{ .i = 1 };
    const bar: ??S = null;
    const baz = if (runtime_bool) foo else bar;
    std.debug.print("{}\n", .{@TypeOf(baz)}); // => ??S
}

Extracted from #2258

Initial implementation attempt: 18fda3a

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions