diegoles / closure-library

Automatically exported from code.google.com/p/closure-library
0 stars 0 forks source link

param annotation at goog.ui.Container.addChild #510

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
goog.ui.Container.addChild(child, opt_renderer) requires child parameter to be 
goog.ui.Component (annotation @param {goog.ui.Component} child The new child 
control.)
It says that child should be control. And also first line of this method 
asserts that:
goog.asserts.assertInstanceof(child, goog.ui.Control,'The child of a container 
must be a control');

So please change the annotation to this:
@param {goog.ui.Control} child The new child control.

Original issue reported on code.google.com by Martin.R...@gmail.com on 23 Oct 2012 at 8:15

GoogleCodeExporter commented 8 years ago
this would not be sound. see:
http://closuretools.blogspot.com/2012/06/subtyping-functions-without-poking-your
.html

Original comment by Nicholas.J.Santos on 23 Oct 2012 at 9:05