typeGuardsInClassMethods.ts(10,9): error TS2322: Type 'number | false' is not assignable to type 'number'.
  Type 'boolean' is not assignable to type 'number'.
typeGuardsInClassMethods.ts(14,9): error TS2322: Type 'number | false' is not assignable to type 'number'.
  Type 'boolean' is not assignable to type 'number'.
typeGuardsInClassMethods.ts(14,22): error TS2454: Variable 'var2' is used before being assigned.
typeGuardsInClassMethods.ts(17,9): error TS2322: Type 'number | false' is not assignable to type 'number'.
  Type 'boolean' is not assignable to type 'number'.
typeGuardsInClassMethods.ts(22,9): error TS2322: Type 'number | false' is not assignable to type 'number'.
  Type 'boolean' is not assignable to type 'number'.
typeGuardsInClassMethods.ts(26,9): error TS2322: Type 'number | false' is not assignable to type 'number'.
  Type 'boolean' is not assignable to type 'number'.
typeGuardsInClassMethods.ts(26,22): error TS2454: Variable 'var2' is used before being assigned.
typeGuardsInClassMethods.ts(29,9): error TS2322: Type 'number | false' is not assignable to type 'number'.
  Type 'boolean' is not assignable to type 'number'.
typeGuardsInClassMethods.ts(34,9): error TS2322: Type 'number | false' is not assignable to type 'number'.
  Type 'boolean' is not assignable to type 'number'.
typeGuardsInClassMethods.ts(38,9): error TS2322: Type 'number | false' is not assignable to type 'number'.
  Type 'boolean' is not assignable to type 'number'.
typeGuardsInClassMethods.ts(38,22): error TS2454: Variable 'var2' is used before being assigned.
typeGuardsInClassMethods.ts(41,9): error TS2322: Type 'number | false' is not assignable to type 'number'.
  Type 'boolean' is not assignable to type 'number'.
typeGuardsInClassMethods.ts(46,9): error TS2322: Type 'number | false' is not assignable to type 'number'.
  Type 'boolean' is not assignable to type 'number'.
typeGuardsInClassMethods.ts(50,9): error TS2322: Type 'number | false' is not assignable to type 'number'.
  Type 'boolean' is not assignable to type 'number'.
typeGuardsInClassMethods.ts(50,22): error TS2454: Variable 'var2' is used before being assigned.
typeGuardsInClassMethods.ts(53,9): error TS2322: Type 'number | false' is not assignable to type 'number'.
  Type 'boolean' is not assignable to type 'number'.
typeGuardsInClassMethods.ts(58,9): error TS2322: Type 'number | false' is not assignable to type 'number'.
  Type 'boolean' is not assignable to type 'number'.
typeGuardsInClassMethods.ts(62,9): error TS2322: Type 'number | false' is not assignable to type 'number'.
  Type 'boolean' is not assignable to type 'number'.
typeGuardsInClassMethods.ts(62,22): error TS2454: Variable 'var2' is used before being assigned.
typeGuardsInClassMethods.ts(65,9): error TS2322: Type 'number | false' is not assignable to type 'number'.
  Type 'boolean' is not assignable to type 'number'.


==== typeGuardsInClassMethods.ts (20 errors) ====
    // Note that type guards affect types of variables and parameters only and 
    // have no effect on members of objects such as properties. 
    
    // variables in global
    var num: number;
    var var1: string | number;
    class C1 {
        constructor(param: string | number) {
            // global vars in function declaration
            num = typeof var1 === "string" && var1.length; // string
            ~~~
!!! error TS2322: Type 'number | false' is not assignable to type 'number'.
!!! error TS2322:   Type 'boolean' is not assignable to type 'number'.
    
            // variables in function declaration
            var var2: string | number;
            num = typeof var2 === "string" && var2.length; // string
            ~~~
!!! error TS2322: Type 'number | false' is not assignable to type 'number'.
!!! error TS2322:   Type 'boolean' is not assignable to type 'number'.
                         ~~~~
!!! error TS2454: Variable 'var2' is used before being assigned.
    
            // parameters in function declaration
            num = typeof param === "string" && param.length; // string
            ~~~
!!! error TS2322: Type 'number | false' is not assignable to type 'number'.
!!! error TS2322:   Type 'boolean' is not assignable to type 'number'.
        }
        // Inside function declaration
        private p1(param: string | number) {
            // global vars in function declaration
            num = typeof var1 === "string" && var1.length; // string
            ~~~
!!! error TS2322: Type 'number | false' is not assignable to type 'number'.
!!! error TS2322:   Type 'boolean' is not assignable to type 'number'.
    
            // variables in function declaration
            var var2: string | number;
            num = typeof var2 === "string" && var2.length; // string
            ~~~
!!! error TS2322: Type 'number | false' is not assignable to type 'number'.
!!! error TS2322:   Type 'boolean' is not assignable to type 'number'.
                         ~~~~
!!! error TS2454: Variable 'var2' is used before being assigned.
    
            // parameters in function declaration
            num = typeof param === "string" && param.length; // string
            ~~~
!!! error TS2322: Type 'number | false' is not assignable to type 'number'.
!!! error TS2322:   Type 'boolean' is not assignable to type 'number'.
        }
        // Inside function declaration
        p2(param: string | number) {
            // global vars in function declaration
            num = typeof var1 === "string" && var1.length; // string
            ~~~
!!! error TS2322: Type 'number | false' is not assignable to type 'number'.
!!! error TS2322:   Type 'boolean' is not assignable to type 'number'.
    
            // variables in function declaration
            var var2: string | number;
            num = typeof var2 === "string" && var2.length; // string
            ~~~
!!! error TS2322: Type 'number | false' is not assignable to type 'number'.
!!! error TS2322:   Type 'boolean' is not assignable to type 'number'.
                         ~~~~
!!! error TS2454: Variable 'var2' is used before being assigned.
    
            // parameters in function declaration
            num = typeof param === "string" && param.length; // string
            ~~~
!!! error TS2322: Type 'number | false' is not assignable to type 'number'.
!!! error TS2322:   Type 'boolean' is not assignable to type 'number'.
        }
        // Inside function declaration
        private static s1(param: string | number) {
            // global vars in function declaration
            num = typeof var1 === "string" && var1.length; // string
            ~~~
!!! error TS2322: Type 'number | false' is not assignable to type 'number'.
!!! error TS2322:   Type 'boolean' is not assignable to type 'number'.
    
            // variables in function declaration
            var var2: string | number;
            num = typeof var2 === "string" && var2.length; // string
            ~~~
!!! error TS2322: Type 'number | false' is not assignable to type 'number'.
!!! error TS2322:   Type 'boolean' is not assignable to type 'number'.
                         ~~~~
!!! error TS2454: Variable 'var2' is used before being assigned.
    
            // parameters in function declaration
            num = typeof param === "string" && param.length; // string
            ~~~
!!! error TS2322: Type 'number | false' is not assignable to type 'number'.
!!! error TS2322:   Type 'boolean' is not assignable to type 'number'.
        }
        // Inside function declaration
        static s2(param: string | number) {
            // global vars in function declaration
            num = typeof var1 === "string" && var1.length; // string
            ~~~
!!! error TS2322: Type 'number | false' is not assignable to type 'number'.
!!! error TS2322:   Type 'boolean' is not assignable to type 'number'.
    
            // variables in function declaration
            var var2: string | number;
            num = typeof var2 === "string" && var2.length; // string
            ~~~
!!! error TS2322: Type 'number | false' is not assignable to type 'number'.
!!! error TS2322:   Type 'boolean' is not assignable to type 'number'.
                         ~~~~
!!! error TS2454: Variable 'var2' is used before being assigned.
    
            // parameters in function declaration
            num = typeof param === "string" && param.length; // string
            ~~~
!!! error TS2322: Type 'number | false' is not assignable to type 'number'.
!!! error TS2322:   Type 'boolean' is not assignable to type 'number'.
        }
    }
    