Skip to content

How do I handle instancing with interfaces #821

Answered by Hedwig7s
Hedwig7s asked this question in Q&A
Discussion options

You must be logged in to vote

Figured it out can do it like this:

local interface InstanceFunctions
    a: function(self:Instance, a:string)
end
local record Class is middleclass.Class, InstanceFunctions -- Example middleclass Class type
    initialize: function(a:number)
end
local record Instance is middleclass.Instance, InstanceFunctions
    b: number
end

Replies: 4 comments 7 replies

Comment options

You must be logged in to vote
2 replies
@alerque
Comment options

@catwell
Comment options

Comment options

You must be logged in to vote
2 replies
@Hedwig7s
Comment options

@hishamhm
Comment options

Comment options

You must be logged in to vote
3 replies
@Hedwig7s
Comment options

@hishamhm
Comment options

@Hedwig7s
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by Hedwig7s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants