You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have an enum containing some polymorphic structs:
mod picture {pubenumPicture{Picture8(~Pixels<u8>),Picture16(~Pixels<u16>),}pubstructPixels<S>(~PixelsInfo<S>, ~[S]);pubstructPixelsInfo<S>{transparent:Option<S>,background:Option<S>,}}
which is used as:
let pixels_info: ~picture::PixelsInfo<u8> = ~picture::PixelsInfo{transparent:Some(20),background:None,};
It works fine when it is in the same file as the code that uses it, but when I place it in a different crate, I got strange type errors (shortened):
error: mismatched types: expected `~picture::PixelsInfo<'a>` but found `~picture::PixelsInfo<u8>` (expected type parameter but found u8)
error: mismatched types: expected `~['a]` but found `~[u8]` (expected type parameter but found u8)
error: mismatched types: expected `~picture::Pixels<u8>` but found `~picture::Pixels<'a>` (expected u8 but found type parameter)
The error message is also confusing a bit, because the 'a ("expected ~picture::Pixels<u8> but found ~picture::Pixels<'a>) looks like a region bound (&'a foo), but seems to be a type metavariable (but I might be wrong, as I don't really understand the details of the compiler).
The text was updated successfully, but these errors were encountered:
Hi,
I have an enum containing some polymorphic structs:
which is used as:
It works fine when it is in the same file as the code that uses it, but when I place it in a different crate, I got strange type errors (shortened):
(the full source code is at https://gist.github.com/honzasp/5693895 -- type
make
to see it in action)The error message is also confusing a bit, because the
'a
("expected~picture::Pixels<u8>
but found~picture::Pixels<'a>
) looks like a region bound (&'a foo
), but seems to be a type metavariable (but I might be wrong, as I don't really understand the details of the compiler).The text was updated successfully, but these errors were encountered: