1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69
|
/// <reference path="fourslash.ts" />
//// class RoyalGuard {
//// isLeader(): this is LeadGuard {
//// return this instanceof LeadGuard;
//// }
//// isFollower(): this is FollowerGuard {
//// return this instanceof FollowerGuard;
//// }
//// }
////
//// class LeadGuard extends RoyalGuard {
//// lead(): void {};
//// }
////
//// class FollowerGuard extends RoyalGuard {
//// follow(): void {};
//// }
////
//// let a: RoyalGuard = new FollowerGuard();
//// if (a.is/*1*/Leader()) {
//// a./*2*/;
//// }
//// else if (a.is/*3*/Follower()) {
//// a./*4*/;
//// }
////
//// interface GuardInterface {
//// isLeader(): this is LeadGuard;
//// isFollower(): this is FollowerGuard;
//// }
////
//// let b: GuardInterface;
//// if (b.is/*5*/Leader()) {
//// b./*6*/;
//// }
//// else if (b.is/*7*/Follower()) {
//// b./*8*/;
//// }
////
//// if (((a.isLeader)())) {
//// a./*9*/;
//// }
//// else if (((a).isFollower())) {
//// a./*10*/;
//// }
////
//// if (((a["isLeader"])())) {
//// a./*11*/;
//// }
//// else if (((a)["isFollower"]())) {
//// a./*12*/;
//// }
////
//// let leader/*13*/Status = a.isLeader();
//// function isLeaderGuard(g: RoyalGuard) {
//// return g.isLeader();
//// }
//// let checked/*14*/LeaderStatus = isLeader/*15*/Guard(a);
verify.quickInfos({
1: "(method) RoyalGuard.isLeader(): this is LeadGuard",
3: "(method) RoyalGuard.isFollower(): this is FollowerGuard",
5: "(method) GuardInterface.isLeader(): this is LeadGuard",
7: "(method) GuardInterface.isFollower(): this is FollowerGuard",
13: "let leaderStatus: boolean",
14: "let checkedLeaderStatus: boolean",
15: "function isLeaderGuard(g: RoyalGuard): boolean"
});
|