HoriSun / closure-compiler

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

Interfaces not getting resolved because of declaration order #1289

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hey Nick, can you take a look at this? I spent a few hours on it, but I don't 
know TypedScopeCreator well so I couldn't figure it out.

Basically, for 2 or more levels of inheritance for interfaces, the compiler 
doesn't resolve them correctly if they're not declared in order. For classes it 
works fine. 

This was uncovered by a google-internal project. It works correctly in the new 
type inference, but it's not ready to land, so it's probably better to fix it 
in the existing type inference as well.

See example below.

/** @interface @extends {MidI} */
function LowI() {}

/** @interface @extends {HighI} */
function MidI() {}

/** @interface */
function HighI() {}

/** @constructor @extends {MidC} */
function LowC() {}

/** @constructor @extends {HighC} */
function MidC() {}

/** @constructor */
function HighC() {}

Original issue reported on code.google.com by dim...@google.com on 25 Mar 2014 at 8:23

GoogleCodeExporter commented 9 years ago
sure, i'll take a look

Original comment by Nicholas.J.Santos on 25 Mar 2014 at 11:57

GoogleCodeExporter commented 9 years ago
just to clarify, the example with the constructors works fine. it's just the 
one with the interfaces that's broken. right?

Original comment by Nicholas.J.Santos on 26 Mar 2014 at 12:46

GoogleCodeExporter commented 9 years ago
http://codereview.appspot.com/80260043/

Original comment by Nicholas.J.Santos on 26 Mar 2014 at 1:13

GoogleCodeExporter commented 9 years ago
Thanks for looking into this! I've added some comments to the review.

Original comment by dim...@google.com on 26 Mar 2014 at 6:03

GoogleCodeExporter commented 9 years ago
This issue was closed by revision bad5890d0a9c.

Original comment by Nicholas.J.Santos on 27 Mar 2014 at 2:01