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

Strip Luau types #34

Closed
jeparlefrancais opened this issue Aug 30, 2021 · 2 comments · Fixed by #130
Closed

Strip Luau types #34

jeparlefrancais opened this issue Aug 30, 2021 · 2 comments · Fixed by #130
Labels

Comments

@jeparlefrancais
Copy link
Contributor

Once darklua is able to process Luau, create a rule that strips the type information.

Related to #40

@jeparlefrancais
Copy link
Contributor Author

In GitLab by @matthargett on Sep 7, 2021, 18:12

should only strip types if they aren't exported, or used by an exported type. example:

export type Foo = { GlobalBaz: Baz }
type Bar = { string }
type Baz = { [string]: (...number) -> () }
local function f(_bar: Bar): ()
end
return { f = f }

->

export type Foo = { GlobalBaz: Baz }

type Baz = { [string]: (...number) -> () }
local function f(_bar)
end
return { f = f }

@jeparlefrancais
Copy link
Contributor Author

In GitLab by @matthargett on Sep 9, 2021, 19:34

actually, whether to strip all types versus only non-exported types should probably be a configuration option. completely stripping types would probably be useful when wanting to run Luau code in other Lua runtimes. stripping all types by default is probably the best first step.

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

Successfully merging a pull request may close this issue.

1 participant