Hello Developers
I am creating a small module to handle lazy Iterators
(heavily inspired by rustlang’s Iterator trait)
The type Iter
is defined by
Since type recursion is not allowed while defining custom types (by this I mean that while defining a type with a generic, it cannot depend on the same type with a different generic),
I decided to separate the Iter
type into BaseIter
(containing properties of Iter
) and IterImpl
(containing the various methods of iterators)
The Problem
When creating trying to index an Iter
object with the colon operator :
, it doesnt autocomplete/provide lsp for the defined type Iter<Item>
iota
is just a function which creates a new iterator with sequential number values
When the function name is typed out, it provides the function’s type as seen below
The weird part is that after calling the first method on the Iter
object, and indexing it with :
, it autocompletes.
I don’t know if this has to do anything with the constructor, but here it is:
Does anyone know why/how this happens and how I could potentially fix this?
Thank you so much!