-
-
Notifications
You must be signed in to change notification settings - Fork 13
Open
Labels
bugSomething isn't workingSomething isn't working
Description
Description
When re-exporting a type that has a generic default parameter, pesde includes the default even when the default type itself is not exported. This causes errors for developers trying to use the re-exported type.
Example
-- In the source package (not exported)
type Callback = () -> ()
-- In the source package (exported)
export type ReadonlySignal<T = Callback> = ...
-- After re-export in dependent package
export type ReadonlySignal<T = Callback> = module.ReadonlySignal<T>The re-exported type still references Callback as the default, but Callback was never exported, causing an error when trying to use ReadonlySignal without explicit type parameters.
Current Behavior
Generic defaults are preserved in re-exports even when the default type is not exported, resulting in references to undefined types.
Expected Behavior
Either:
- Strip generic defaults when re-exporting if the default type is not also exported, or
- Automatically detect and re-export types used as generic defaults
Reproduction
Either:
- Create a package with a type that has a generic default referencing an internal type
- Re-export that type without exporting the default type
- Try to use the re-exported type in a package without providing the generic parameter
- Observe error about undefined type
Or:
- Add dependency:
wcs = { wally = "cheetiedotpy/wcs", version = "^2.5.0" } - Re-export
ReadonlySignalfrom wcs:export type ReadonlySignal<T = Callback> = module.ReadonlySignal<T> - Try to use the re-exported type in a package without providing the generic parameter
- Observe error about undefined
Callbacktype
Environment
- Luau
- pesde:
pesde-pkg/pesde@0.7.1+registry.0.2.3 - Operating system: Windows 10
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working