Type UVError in base

This looks a bit troublesome.
Why is the inner constructor needed?
The inner constructor also is ::Integer however code only accepts Int32.
I’m led to believe these are bugs.

The real question is why do we have this type at all? We shouldn’t be surfacing details of the library we use for I/O to the user.

1 Like

I think it’s primarily used for internal handling of errors with libuv. The type UVError is not exported.

This is not a bug. It will not error if you pass in a Int64.

The code::Int32 in the UVError type will actually do a convert? My understanding was it was more of an assertion.

The ::Int32 here is not an assertion. It’s a declaration of slot type much like local a::Int32 or Vector{Int32}. When assigning to such a location, there’s an implicit conversion and type assertion.

I believe these are documented in the types doc (search for convert in the page).