function setWithStringLiteral ( ) { const set = new Set ( 'abc' ) ; } function setWithStringVariable ( s ) { const set = new Set ( s ) ; } function setWithStringUnionType ( s ) { const set = new Set ( s ) ; } function setWithStringExpression ( fn ) { const set = new Set ( fn ( ) ) ; } function setWithStringExpression2 ( ) { const set = new Set ( Math . random ( ) < 0.5 ? 'a' : 'b' ) ; } type TypeA = string | Set < string > ; type TypeB = TypeA | ( Iterable < string > & IterableIterator < string > ) ; function setWithComplexInitializationType ( s ) { const set = new Set ( s ) ; } function setWithUnionStringType ( s ) { const set = new Set ( s ) ; } function setWithLocalAlias ( ) { const TotallyNotASet = Set ; const set = new TotallyNotASet ( 'abc' ) ; } function setWithMultipleAliases ( ) { const Foo = Set ; const Bar = Foo ; const Baz = Bar ; const set = new Baz ( 'abc' ) ; } function setUsingSetConstructorType ( ctor ) { const set = new ctor ( 'abc' ) ; } type MySet = SetConstructor ; function setUsingAliasedSetConstructor ( ctor ) { const set = new ctor ( 'abc' ) ; }