var x: StringTree;
type StringTree = string | StringTreeArray;
interface StringTreeArray extends Array<StringTree> {}
This code gets a "Type alias 'StringTree' circularly references itself." error. I believe it should be allowed per the spec, since the Type Aliases section doesn't say that an interface type depends on its base interfaces.
If I move the variable declaration below the type and interface, then the error goes away, but the language service still reports that x has type any.