Custom type doesnt work as intented

Hello Developers :wave:
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)
image

image

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>
image
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!

Can you show me the type behind Iota?

(bump bump)
still have no idea why it isnt working

The limitation on recursive type iteration for chained type class has been acknowledged but unfortunately remains to be solved: RFC: Loosening the recursive type restriction by asajeffrey · Pull Request #86 · luau-lang/luau · GitHub

As for your problem, I swapped self with IterImpl instead of BaseIter<Item> & IterImpl and seemed to have solved the syntactic sugar of using :.

Also for future reference, try not to upload screenshots of code but instead use the ```lua codeblock instead.