I am wondering: why goog.getCssName('some-string') is considered a constant (and thus work with goog.string.Const.from()) and
/** @const {string} */
var a = goog.getCssName('some-string')
function getCssClas() { return a; }
goog.string.Const.from(getCssClass())
is not working... when running via compiler passes both should evaluate to the same constant....
My use case is a bit more complicated than that: ControlRenderer class has 'getCssClass' that I specifically override to return a static property assigned (and documented as const) via goog.getCssNam('somestring')
In theory the compiler should be able to see that 'this.getCssClass()' returns a constant (return MyRenderer.CSS_CLASS <- this is assigned as constant from getCssName), but it does not and makes me repeat the constant.
Maybe the const check pass is earlier, or simply it does not look for the result of the expression in the call and when it sees a property access gives up, even if it always returns a constant?