Test that internal constructor return type asserts are respected (#47227)
On Julia 1.8, if the internal constructor's return value was typeasserted,
this assertion could be violated without an error. For example, in this case:
```julia
struct Foo
x::Int
Foo()::Nothing = new(1)
end
```
Running `Foo()` would not throw. This was inadvertently fixed in a later PR,
but not tested.
This PR adds a test case similar to the example above.