GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — Add support for "this is X" style user-defined type guards · Issue #5764 · microsoft/TypeScript Closed Labels FixedA PR has been merged for this issueA PR has been merged for this issueSuggestionAn idea for TypeScriptAn idea for TypeScript Milestone DescriptionI'd like to use user-defined type guards in the following manner: abstract class Animal { get isDog(): this is Dog; } class Dog extends Animal { get isDog(): this is Dog { return true; } bark() { console.log("woof"); } } let animal = new Dog(); if (animal.isDog) { animal.bark() } This use-case was suggested by Ryan Cavanaugh (@RyanCavanaugh) when he opened #1007 but seems to be unsupported as of TypeScript 1.6. Activity
MetadataMetadataAssigneesLabelsFixedA PR has been merged for this issueA PR has been merged for this issueSuggestionAn idea for TypeScriptAn idea for TypeScript TypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |