Comments (1)
Those completions are computed based on the contextual type and it seems that return types of getters are not contextually-typed here:
interface Test1 {
foo: (arg: number) => void;
}
const t1: Test1 = {
get foo() {
// Parameter 'arg' implicitly has an 'any' type.(7006)
return (arg) => {};
},
};
interface Test2 {
bar: [string]
}
const t2: Test2 = {
get bar() {
// Type 'string[]' is not assignable to type '[string]'.
// Target requires 1 element(s) but source may have fewer.(2322)
return ['']
},
};
from typescript.
Related Issues (20)
- Incorrect type inferrence that sub-class does not extend super-class with generics HOT 3
- [NewErrors] 5.5.0-dev.20240602 vs 5.4.5 HOT 29
- [ServerErrors][JavaScript] 5.5.0-dev.20240602 HOT 11
- [ServerErrors][TypeScript] 5.5.0-dev.20240602 HOT 26
- Debug failure on paste with imports
- [TS2742] Occurs building a library that depends on `@reduxjs/toolkit`
- Promise<T> where T is an object allows additional keys on T HOT 1
- Module resolution: tsconfig.json#compilerOptions/path does not support files in parent folder
- Annotated parameters are not used for inferring rest parameters HOT 2
- [ts-5.5-rc] Import elided in spite of being use in declarations
- Delete or Change Unavailable YouTube Video in /why-create-typescript
- [ts-5.5]Some types are excessively expanded in keyof and index access types
- `for (const x in #b)` is allowed
- Can't augment function overload is function is exported via `export {}` HOT 2
- Design Meeting Notes, 5/31/2024 HOT 2
- `lib.d.ts` Updates for TypeScript 5.6
- Conditional type does not work when generic
- Assignment fails with boolean return type and recursive type HOT 2
- [ServerErrors][TypeScript] 5.5.0-dev.20240603 HOT 17
- Inline JSX.Element import for component returning null conditionally HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from typescript.