-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Open
Labels
Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featureThis means we'd like to hear from more people who would be helped by this featureSuggestionAn idea for TypeScriptAn idea for TypeScript
Description
TypeScript Version: 2.0.3
Code
Why I can have function type guard:
function hasValue<T>(value: T | undefined): value is T { return value !== undefined; }but not method type guard:
export class Maybe<T> {
constructor(public value: T | undefined) {}
hasValue(): this.value is T { return this.value !== undefined; }
// ^ '{' or ';' expected.
}?
tinganho, mattmazzola, amitport, vyshkant, cevek and 37 more
Metadata
Metadata
Assignees
Labels
Awaiting More FeedbackThis means we'd like to hear from more people who would be helped by this featureThis means we'd like to hear from more people who would be helped by this featureSuggestionAn idea for TypeScriptAn idea for TypeScript