# allow implicit cast from &const to ?&const &const · gitcafe/zig

[View on GitCafe](https://git.cafe/gitcafe/zig/commit/9aa65c0e8e6e4135dcc04bcb388d1fa38c6d10f6)

Repository: [gitcafe/zig](https://git.cafe/gitcafe/zig)

Visibility: public

Requested revision: 9aa65c0e8e6e4135dcc04bcb388d1fa38c6d10f6

Requested commit: 9aa65c0e8e6e4135dcc04bcb388d1fa38c6d10f6

Commit: 9aa65c0e8e6e4135dcc04bcb388d1fa38c6d10f6

Tree: d7bedb06367d28f4851fc2020f3fa6ca84b96294

Author: Ben Noordhuis

Committer: Ben Noordhuis

## Message

```
allow implicit cast from &const to ?&const &const

Allow implicit casts from n-th degree const pointers to nullable const
pointers of degree n+1.  That is:

    fn f() void {
        const s = S {};
        const p = &s;
        g(p);   // Works.
        g(&p);  // So does this.
    }

    fn g(_: ?&const &const S) void {  // Nullable 2nd degree const ptr.
    }

Fixes #731 some more.

```

## Parents

- [1eecfdaa9b9c04e50058695b8df9978ef47f121a](https://git.cafe/gitcafe/zig/commit/1eecfdaa9b9c04e50058695b8df9978ef47f121a?format=markdown)

[Source at this commit](https://git.cafe/gitcafe/zig/tree/9aa65c0e8e6e4135dcc04bcb388d1fa38c6d10f6?format=markdown)
