# stage1: make get_optional_type more robust · gitcafe/zig

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

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

Visibility: public

Requested revision: fa46bcb36864e6616ce4449965063f3b8720f8e1

Requested commit: fa46bcb36864e6616ce4449965063f3b8720f8e1

Commit: fa46bcb36864e6616ce4449965063f3b8720f8e1

Tree: d0f486600d651e47609ac57bed117422791930bc

Author: Andrew Kelley

Committer: Andrew Kelley

## Message

```
stage1: make get_optional_type more robust

Now it will emit a compile error rather than crashing when the child
type has not been resolved properly.

Introduces `get_optional_type2` which should be used generally inside
ir.cpp.

Fix some std lib compile errors noticed by the provided test case.

Thanks @LemonBoy for the test case. Closes #4377.

Fixes #4374.

```

## Parents

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

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