Currently converting my 3D skybox module to use types, but forgot to annotate them on the functions themselves. Got this messed up error which left me confused for a while:
W000: (531,4) Type '({+ AmbientColorDay: Color3, AmbientColorNight: Color3, ... 3 more ... +}, Color3) -> ()' could not be converted into 't1 where Skybox3D = {| AmbientColorDay: Color3, AmbientColorNight: Color3, ... 19 more ... |} ; t1 = (Skybox3D, Color3) -> ()'
Here are the code snippets that caused this:
type Skybox3D = {
...
SetViewportFrameZIndex:(Skybox3D,number)->(),
...
SetWorldScale:(Skybox3D,number)->(),
SetCameraOrigin:(Skybox3D,Vector3)->(),
SetLightSource:(Skybox3D,string)->(),
SetAmbientColorDay:(Skybox3D,Color3)->(),
SetAmbientColorNight:(Skybox3D,Color3)->(),
SetLightColorDay:(Skybox3D,Color3)->(),
SetLightColorNight:(Skybox3D,Color3)->(),
SetActive:(Skybox3D,boolean)->(),
Destroy:(Skybox3D)->(),
}
...
local skySetWorldScale = function(self,scale)
...
end
local skySetCameraOrigin = function(self,ori)
...
end
local skySetViewportFrameZIndex = function(self,zindex)
...
end
local skySetLightSource = function(self,source)
...
end
local skySetAmbientColorDay = function(self,ambientday)
...
end
local skySetAmbientColorNight = function(self,ambientnight)
...
end
local skySetLightColorDay = function(self,lightday)
...
end
local skySetLightColorNight = function(self,lightnight)
...
end
local skySetActive = function(self,active)
...
end
local skyDestroy = function(self)
...
end