-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
Needs InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.VS Code TrackedThere is a VS Code equivalent to this issueThere is a VS Code equivalent to this issue
Description
From: microsoft/vscode#30819
TypeScript Version: 2.4.2
Code
In a vscode extension:
import * as vscode from 'vscode'
interface MyPickItem extends vscode.QuickPickItem { }
var items:MyPickItem[];
vscode.window.showQuickPick(items, {
placeHolder: "(placeholder)",
onDidSelectItem: (item:MyPickItem) => {
/* Wont copile, error:
Argument of type '{ placeHolder: string; onDidSelectItem: (item: MyPickItem) => void; }' is not assignable to parameter of type 'QuickPickOptions'.
Types of property 'onDidSelectItem' are incompatible.
Type '(item: MyPickItem) => void' is not assignable to type '<T extends QuickPickItem>(item: string | T) => any'.
Types of parameters 'item' and 'item' are incompatible.
Type 'string | T' is not assignable to type 'MyPickItem'.
Type 'string' is not assignable to type 'MyPickItem'.
*/
}
});Expected behavior:
Since MyPickItem extends QuickPickItem, the above call to vscode.window.showQuickPick should be valid
Actual behavior:
Compiler error
More information about this issue:
From: microsoft/vscode#30819
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Needs InvestigationThis issue needs a team member to investigate its status.This issue needs a team member to investigate its status.VS Code TrackedThere is a VS Code equivalent to this issueThere is a VS Code equivalent to this issue