问题 I have a function a that should returns any if no generic type is provided, T otherwise. var a = function<T>() : T { return null; } var b = a<number>(); //number var c = a(); //c is {}. Not what I want... I want c to be any. var d; //any var e = a<typeof d>(); //any Is it possible? (Without changing the function calls obviously. AKA without a<any>() .) 回答1: Is it possible? (Without changing the function calls obviously. AKA without a().) Yes. I believe in your case you would do var a =