Closed GoogleCodeExporter closed 9 years ago
Unfortunately the type annotation can't be updated without updating hundreds of
projects which call goog.object.get with {Object} parameter instead of
{!Object}.
Accepting null in the first argument would make goog.object.get's behavior
inconsistent with the rest of the functions in that file.
Original comment by pall...@google.com
on 19 Oct 2012 at 8:27
Then IMHO the logical solution is to fix the behavior of all these
functions to consistently match their type specification.
Original comment by bem...@google.com
on 19 Oct 2012 at 3:55
This is this way due to historical reason. goog.object was never meant to
accept non-null parameter. In the past, the compiler default was that the
annotation Object means non-null. This was changed (probably prior to open
sourcing) to mean Object|null. However, fixing this kind of annotation issues
is hard (and goog.object is not the only one affected unfortunately). Adding
null checks are not usually desirable due to the additional bytes sent to
client. Though adding goog.asserts.assert may be a reasonable alternative.
Original comment by chrishe...@google.com
on 19 Oct 2012 at 7:37
Original issue reported on code.google.com by
bem...@google.com
on 11 Oct 2012 at 5:02