Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Troubles with luau types #82

Open
lopi-py opened this issue Nov 3, 2022 · 5 comments
Open

Troubles with luau types #82

lopi-py opened this issue Nov 3, 2022 · 5 comments

Comments

@lopi-py
Copy link

lopi-py commented Nov 3, 2022

[Edit]: Also lack of BidirectionalEvent, OnEvent and OnFunction

given this

--!strict
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local Net = require(ReplicatedStorage.Packages.Net)

return Net.CreateDefinitions({
    Cuffs = Net.Definitions.Namespace({}), --> error here
})
TypeError: Type '{ Cuffs: {ClientAsyncFunctionDefinition | ClientToServerEventDefinition | ServerAsyncFunctionDefinition | ServerFunctionDefinition | ServerToClientEventDefinition} }' could not be converted into 'RemoteDefinitions'
caused by:
  Property 'Cuffs' is not compatible. Type 'ClientAsyncFunctionDefinition | ClientToServerEventDefinition | ServerAsyncFunctionDefinition | ServerFunctionDefinition | ServerToClientEventDefinition' could not be converted into '{ClientAsyncFunctionDefinition | ClientToServerEventDefinition | ServerAsyncFunctionDefinition | ServerFunctionDefinition | ServerToClientEventDefinition}'
caused by:
  Not all union options are compatible. Table type 'ServerToClientEventDefinition' not compatible with type '{ClientAsyncFunctionDefinition | ClientToServerEventDefinition | ServerAsyncFunctionDefinition | ServerFunctionDefinition | ServerToClientEventDefinition}' because the former has extra field '__nominal_ServerToClientEventDefinition'Luau[1000](https://luau-lang.org/typecheck)

currently using luau-lsp

@lopi-py
Copy link
Author

lopi-py commented Nov 22, 2022

@Vorlias any update on this?, I really like this module but it's so annoying to have huge errors every time I want to edit the remotes

@Vorlias
Copy link
Member

Vorlias commented Nov 24, 2022

Yeah, sorry been quite overloaded with stuff at the moment so haven't had as much time to look into things like this. Will try to look into this today.

@Vorlias
Copy link
Member

Vorlias commented Nov 24, 2022

Package updated - vorlias/[email protected]. Types should be fixed now.

@Vorlias Vorlias closed this as completed Nov 24, 2022
@Vorlias
Copy link
Member

Vorlias commented Nov 24, 2022

I realised I missed adding BidirectionalEvent - will fix that at some point.

@Vorlias Vorlias reopened this Nov 24, 2022
@lopi-py
Copy link
Author

lopi-py commented Nov 25, 2022

Ok thanks for fixing that, can't wait for bidirectional event fix 😄🤞

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants