Open tmayr opened 2 years ago
Error:
@preact-signals/utils:build: x the name `Uncached` is defined multiple times
@preact-signals/utils:build: ,-[D:\Projects\open-source\preact-signals\packages\utils\src\$.ts:17:1]
@preact-signals/utils:build: 17 | * <div>{$(() => sig.value * 10)}</div>
@preact-signals/utils:build: 18 | * ```
@preact-signals/utils:build: 19 | */
@preact-signals/utils:build: 20 | declare class Uncached<T> extends Signal<T> {
@preact-signals/utils:build: : ^^^^|^^^
@preact-signals/utils:build: : `-- previous definition of `Uncached` here
@preact-signals/utils:build: 21 | constructor(accessor: Accessor<T>);
@preact-signals/utils:build: 22 | get value(): T;
@preact-signals/utils:build: 23 | peek(): T;
@preact-signals/utils:build: 24 | valueOf(): T;
@preact-signals/utils:build: 25 | toString(): string;
@preact-signals/utils:build: 26 | /** @internal */
@preact-signals/utils:build: 27 | _a(): T;
@preact-signals/utils:build: 28 | }
@preact-signals/utils:build: 29 |
@preact-signals/utils:build: 30 | // @ts-expect-error
@preact-signals/utils:build: 31 | interface Uncached<T> extends JSX.Element {}
@preact-signals/utils:build: 32 |
@preact-signals/utils:build: 33 | function Uncached<T>(this: Uncached<T>, accessor: Accessor<T>) {
@preact-signals/utils:build: : ^^^^|^^^
@preact-signals/utils:build: : `-- `Uncached` redefined here
@preact-signals/utils:build: 34 | this._a = accessor;
@preact-signals/utils:build: 35 | }
@preact-signals/utils:build: 36 | Uncached.prototype = Object.create(Signal.prototype);
Describe the bug
Cant import a type from another file with the same name as a definition in the current file unless you use it, getting
is defined multiple times
When the type has the same name in the same file, it works fine When the type is being imported, and used, it works fine
I would expect same name values for types to work properly when imported or in the same file.
Input code
Playground link
No response
Expected behavior
Declarations and Types can have the same name when imported.
Actual behavior
Version
1.2.160
Additional context
No response