Type '(a) -> string' could not be converted into '<a>(a) -> string'; different number of generic type parameters

Type Error: (46,5) Type ‘self’ could not be converted into ‘self’
caused by:
Type ‘Participant’ could not be converted into ‘Participant’
caused by:
Type ‘Participant’ from ‘game.ServerScriptService.Server.Classes.Participant’ could not be converted into ‘Participant’ from ‘game.ServerScriptService.Server.Classes.Participant’

So I just got this error and I completely have no idea what this means.

Mind telling me what line this error is taking place on?

This is from line 46, character 5.

I sadly have no idea on how to use “Self” and this may not be much of a help.
So I will link some Dev forums and hopefully they help you!

Links : Why can I never use self?

Sorry im not much of a help.

I don’t really know, I think this must be a Type checking bug.

Possibly, as I said I have no knowledge in “Self” sadly, and wont be much of a help.
I say try experimenting with other ways to do it, and see if that works.

You might need to be more explicit with the typing.

For example, instead of t:k(), try doing
t.k(self: T)

The code will continue work as expected.

If you want a quick hack you can use this pattern to declare a genericless object with a metatable

type x = typeof(setmetatable({}::{

}, {}::{

}))
2 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.