This page is no longer maintained — Please continue to the home page at www.scala-lang.org

parents just don't understand

1 reply
extempore
Joined: 2008-12-17,
User offline. Last seen 35 weeks 3 days ago.

I just commited a fix for this bug:

https://lampsvn.epfl.ch/trac/scala/ticket/1535

However it seems likely the ideal fix lies elsewhere. The crux of the bug is that during that phase, clazz.info.parents does
not return what is apparently expected when called on ClassDecl's clazz.info:

parents = List(BlockStmt, ScalaObject)

I changed the code to use baseClasses, which yields this longer list including the critically missing ASTNode:

baseClasses = List(ClassDecl, BlockStmt, ASTNode, ScalaObject, java.lang.Object)

I feel like perhaps the problem is in the logic for using parentsCache in Types? But I can't find quite tell if I should be
surprised that in a A->B->C hierarchy, C.info.parents might not include A.

BTW this fix breaks binary compatibility rather soundly, as any fix for 1535 necessarily will.

odersky
Joined: 2008-07-29,
User offline. Last seen 45 weeks 6 days ago.
Re: parents just don't understand

Hi Paul,

parents means immediate parents, so indeed you should not be surprised
about this:

> I feel like perhaps the problem is in the logic for using parentsCache in Types? But I can't find quite tell if I should be
> surprised that in a A->B->C hierarchy, C.info.parents might not include A.

Cheers

Copyright © 2012 École Polytechnique Fédérale de Lausanne (EPFL), Lausanne, Switzerland