[Nice-commit] Nice/src/bossa/syntax ClassDefinition.java,1.108,1.109
Brought to you by:
bonniot
From: Daniel B. <bo...@us...> - 2004-09-01 12:07:15
|
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32339/src/bossa/syntax Modified Files: ClassDefinition.java Log Message: Fix classes with less type parameters than a Java parent. Index: ClassDefinition.java =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/ClassDefinition.java,v retrieving revision 1.108 retrieving revision 1.109 diff -C2 -d -r1.108 -r1.109 *** ClassDefinition.java 12 Aug 2004 23:21:41 -0000 1.108 --- ClassDefinition.java 1 Sep 2004 12:06:51 -0000 1.109 *************** *** 266,270 **** if (superClassIdent != null) { ! params = resolveParent(superClassIdent, getLocalScope()); superClass = superClassIdent.tc.resolveToTC(typeScope); --- 266,270 ---- if (superClassIdent != null) { ! useInheritanceParams(resolveParams(superClassIdent, getLocalScope())); superClass = superClassIdent.tc.resolveToTC(typeScope); *************** *** 285,292 **** d.resolve(); ! useParent(d, params); ! ! if(d.getImplementation() instanceof PrimitiveType && ! ! (this.getImplementation() instanceof PrimitiveType)) User.error(this, "A class can't extends a primitive"); } --- 285,290 ---- d.resolve(); ! if (d.getImplementation() instanceof PrimitiveType && ! ! (this.getImplementation() instanceof PrimitiveType)) User.error(this, "A class can't extends a primitive"); } *************** *** 577,581 **** { MonotypeConstructor parent = (MonotypeConstructor) i.next(); ! Monotype[] params = resolveParent(parent, getLocalScope()); TypeIdent name = parent.tc; --- 575,580 ---- { MonotypeConstructor parent = (MonotypeConstructor) i.next(); ! ! useInheritanceParams(resolveParams(parent, getLocalScope())); TypeIdent name = parent.tc; *************** *** 585,592 **** { interfaces.add(s); - - ClassDefinition def = ClassDefinition.get((mlsub.typing.Interface) s); - if (def != null) - useParent(def, params); } else --- 584,587 ---- *************** *** 608,612 **** } ! Monotype[] resolveParent(MonotypeConstructor parent, TypeScope typeScope) { if (parent.parameters == null) --- 603,607 ---- } ! Monotype[] resolveParams(MonotypeConstructor parent, TypeScope typeScope) { if (parent.parameters == null) *************** *** 752,761 **** MethodContainer.Constraint specialize(MethodContainer.Constraint our, - MethodContainer.Constraint parent, Monotype[] params) { - if (parent == null) - return null; - if (params == null) return our; --- 747,752 ---- *************** *** 833,841 **** } ! void useParent(MethodContainer parent, Monotype[] params) { if (parentParams == null) classConstraint = ! specialize(this.classConstraint, parent.classConstraint, params); } --- 824,832 ---- } ! void useInheritanceParams(Monotype[] params) { if (parentParams == null) classConstraint = ! specialize(this.classConstraint, params); } |