tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties.ts(24,6): error TS1162: An object member cannot be declared optional.


==== tests/cases/conformance/types/objectTypeLiteral/methodSignatures/objectTypesWithOptionalProperties.ts (1 errors) ====
    // Basic uses of optional properties
    
    var a: {
        x?: number; // ok
    }
    
    interface I {
        x?: number; // ok
    }
    
    class C {
        x?: number; // ok
    }
    
    interface I2<T> {
        x?: T; // ok
    }
    
    class C2<T> {
        x?: T; // ok
    }
    
    var b = {
        x?: 1 // error
         ~
!!! error TS1162: An object member cannot be declared optional.
    }