Skip to content

[🐞] tracking ReadonlySignal directly doesn't infer proper types #8553

@maiieul

Description

@maiieul

Which component is affected?

Types

Describe the bug

With

    const signal1 = useSignal("signal1") as ReadonlySignal<string>;
    const signal2 = useSignal("signal2");
    useTask$(({ track }) => {
      const tracked = track(signal1);
      signal2.value = tracked;
    });

type of tracked will be ReadonlySignal<string> instead of string. With a Signal<string>, the type of tracked is properly infered as string.

Reproduction

https://qwikdev-build-v2.qwik-8nx.pages.dev/playground/#f=Q0o0pmZm8IgCyiMSgA6QFwS0KD8vpxJSDYNE4HUylAMu73S4oNGhhNpwUQIGCJ4UBjQBETQgq8HtArDphsBgg1uloQQVVNIElilojrKBNDGAiRHdDCNsZhgpAUMApBLeBtCohtbotUhugZkElgHWnLYQlgbUIVAzFGA26QGLBWCBD1WVmgKRBuUOMAMl2pEiHtoyy1T4MH9iN6JBht58AwHnxDz1EgVwNVcCagykKpRnJJYoVOaXQlo1kMoIFPqKSLpskooQiQEEPIDRDmqnpQCDTA9hGawFCAHVKL6qhacliAqw32t1uHBmfUNLpMYtKVkfJe2MZnxaZHwA

Steps to reproduce

No response

System Info

⚡️

Additional Information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions