Generic type parameters in OOP metatable pattern break method autocomplete

When using the standard __index metatable OOP pattern, having a generic type parameter T referenced in any field of the Self type causes method autocomplete to completely stop working when calling methods with : syntax. Replacing T with any in the Self type’s fields immediately restores autocomplete.

Expected behavior
Method autocomplete should work regardless of whether the Self type uses a generic type parameter T or any in its fields. The type solver should be able to resolve generics through the setmetatable() + __index chain and still discover methods on the __index table.

Steps to reproduce
Check the Script (in ServerScriptService) in the attached place file demonstrating the bug.
type bug place.rbxl (58.5 KB)

Beta features
New luau type solver (bug happens with/without),

Hello! I am sorry to hear you are running into this bug. Thank you for the reproduction, but on my machine I can see autocomplete working as you’d expect:

I am working on a MacOS device: are you on Windows perhaps? This could be a platform specific bug.

1 Like

It occurs specifically when using : syntax rather than . for calling the class methods.
typing obj: wont autocomplete the methods, but obj. will.

Changing the generic fields to any then causes obj: to autocomplete as expected.

I am using a Windows device.

Video demonstrating the bug:

Ah! That it does, I’m able to reproduce your issue with :. Sorry about that, reading comprehension failed me there.

We’ll try to keep you in the loop as we figure out the right fix here! Agreed, you should see method autocomplete.

1 Like