I’m really enjoying starting to poke at the crystal-lang type system a little more, but have run into something that has me a little stumped. I’m unsure if this is due to me not quite grokking it completely yet, or an underlying issue / bug.
When declaring an abstract method that has a self-referencing outer type, but free inner such as:
module Functor(T)
abstract def fmap(&block : T -> U) : Functor(U) forall U
end
A compiler warning - Warning: can't resolve return type Functor(U)
- is generated. Given this is generic over U
, I would expect that for this declaration (where the compiler points to for the warning), but would expect that it would be made concrete based on the types on the block when used.
Before opening up a bug, is there something that I’m missing here?