Skip to content

Conversation

@jakebailey
Copy link
Member

Fixes #55901

This is mainly for discussion for now. It appears as though this case is needed in some cases, e.g. in tests/baselines/reference/uniqueSymbolsDeclarations.errors.txt.

uniqueSymbolsDeclarations.ts(104,7): error TS2527: The inferred type of 'constInitToLReadonlyType' references an inaccessible 'unique symbol' type. A type annotation is necessary.
uniqueSymbolsDeclarations.ts(105,7): error TS2527: The inferred type of 'constInitToLReadonlyNestedType' references an inaccessible 'unique symbol' type. A type annotation is necessary.

Which is what @DanielRosenwasser hinted at.

@typescript-bot typescript-bot added Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug labels Oct 2, 2023
Comment on lines +1 to +2
uniqueSymbolsDeclarations.ts(104,7): error TS2527: The inferred type of 'constInitToLReadonlyType' references an inaccessible 'unique symbol' type. A type annotation is necessary.
uniqueSymbolsDeclarations.ts(105,7): error TS2527: The inferred type of 'constInitToLReadonlyNestedType' references an inaccessible 'unique symbol' type. A type annotation is necessary.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These are the cases this breaks an would need to be solved differently; perhaps we can detect this through visibility instead.

method5(p = s) { return p; },
>method5 : (p?: symbol) => symbol
>p : symbol
>method5 : (p?: unique symbol) => symbol
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These kinds of changes don't make me happy and probably indicate that this change is probably not good as-is.

@RyanCavanaugh
Copy link
Member

@typescript-bot pack this

@typescript-bot
Copy link
Collaborator

typescript-bot commented Oct 4, 2023

Heya @RyanCavanaugh, I've started to run the tarball bundle task on this PR at f632137. You can monitor the build here.

@typescript-bot
Copy link
Collaborator

typescript-bot commented Oct 4, 2023

Hey @RyanCavanaugh, I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:

{
    "devDependencies": {
        "typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/158089/artifacts?artifactName=tgz&fileId=F7153853B7D6F5D594DCF79391E2AE0F7D0F43ABAC1928C16C90E1A02229729502&fileName=/typescript-5.3.0-insiders.20231004.tgz"
    }
}

and then running npm install.


There is also a playground for this build and an npm module you can use via "typescript": "npm:@typescript-deploys/[email protected]".;

@jakebailey
Copy link
Member Author

referencing #55860 before I delete this branch

@jakebailey jakebailey deleted the fix-55901 branch March 15, 2024 22:55
@microsoft microsoft locked as resolved and limited conversation to collaborators Oct 16, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Author: Team For Uncommitted Bug PR for untriaged, rejected, closed or missing bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

unique symbol lost on assignment to const despite type assertion

3 participants