-
Notifications
You must be signed in to change notification settings - Fork 13.1k
Closed as not planned
Closed as not planned
Copy link
Labels
DuplicateAn existing issue was already createdAn existing issue was already created
Description
🔎 Search Terms
typescript
generics
arrow function
function
🕗 Version & Regression Information
- This is a crash
- This changed between versions ______ and _______
- This changed in commit or PR _______
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about _________
- I was unable to test this on prior versions because _______
⏯ Playground Link
💻 Code
type C = <
Methods,
Attached = (methods: Methods) => void
>(
options: {
methods: Methods;
attached: Attached;
}
) => any;
var Component: C = () => { }
Component({
attached(methods) {
methods.bbb() // throw ts error
},
methods: {
bbb() { }
}
})
Component({
attached(methods) {
methods.bbb() // ok
},
methods: {
bbb: () => { }
}
})
🙁 Actual behavior
Parameter "methods" in "attach" function should be functions declared in "methods" property, but it works only when function is arrow function.
🙂 Expected behavior
Parameter "methods" in "attach" function should be functions declared in "methods" property
Additional information about the issue
No response
Metadata
Metadata
Assignees
Labels
DuplicateAn existing issue was already createdAn existing issue was already created