ã¾ã master ã«ã¯ãã¼ã¸ãã¦ãªãã§ãã kazuho/user-defined-templates ãã©ã³ãã®ãã¤ã使ãã¨ã class Adder.<T> { static function f(x : T, y : T) : T { return x + y; } } class Test { static function run() : void { var n = Adder.<number>.f(1, 3); log n; var s = Adder.<string>.f("abc", "def"); log s; } } ããæé©åãªãã·ã§ã³ (--optimize inline,fold-const) ã§ã³ã³ãã¤ã«å¾ã« Test.run$ = function () { /** @type {!number} */ var n; /** @type {!string}
{{#tags}}- {{label}}
{{/tags}}