microsoft / microsoft/TypeScript
New error: Type 'string' is not assignable to type 'string & ...'
Open
Nobody has claimed this yet.
Docs
- Dominant language
- Go
- Stars
- 111k
- Forks
- 14.3k
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 132
Description
packages/linear-progress/src/mwc-linear-progress-base.ts:109:9 - error TS2322: Type 'string' is not assignable to type 'string & ((property: string) => string) & ((property: string) => string) & ((index: number) => string) & ((property: string) => string) & ((property: string, value: string | null, priority?: string | undefined) => void)'.
Type 'string' is not assignable to type '(property: string) => string'.
109 this.bufferElement
~~~~~~~~~~~~~~~~~~
110 .style[property as Exclude<keyof CSSStyleDeclaration, 'length'|'parentRule'>] =
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
packages/linear-progress/src/mwc-linear-progress-base.ts:119:9 - error TS2322: Type 'string' is not assignable to type 'string & ((property: string) => string) & ((property: string) => string) & ((index: number) => string) & ((property: string) => string) & ((property: string, value: string | null, priority?: string | undefined) => void)'.
Type 'string' is not assignable to type '(property: string) => string'.
119 this.primaryBar
~~~~~~~~~~~~~~~
120 .style[property as Exclude<keyof CSSStyleDeclaration, 'length'|'parentRule'>] =
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To repro:
npm cinpm run build:stylingtsc -b -f
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the report with npm ci, npm run build:styling, and tsc -b -f. Inspect packages/linear-progress/src/mwc-linear-progress-base.ts at lines 109 and 119, then trace why the indexed CSS style assignments produce TS2322. Done means the reported errors are resolved without breaking the build commands.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- compilers
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 30/100