Thread: [Nice-commit] Nice/src/bossa/syntax methodDeclaration.nice,NONE,1.1 VarSymbol.java,1.39,1.40 alterna
Brought to you by:
bonniot
Update of /cvsroot/nice/Nice/src/bossa/syntax In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1879/F:/nice/src/bossa/syntax Modified Files: VarSymbol.java alternative.nice constructor.nice customConstructor.nice defaultMethod.nice defaultconstructor.nice dispatch.java.bootstrap dispatchTest.nice importedconstructor.nice inline.nice javaFieldAccess.nice javaMethod.nice methodImplementation.nice methodbody.nice niceMethod.nice niceclass.nice nicefieldaccess.nice overloadedsymbol.nice retypedMethod.nice super.nice symbol.nice tools.nice userOperator.nice Added Files: methodDeclaration.nice Removed Files: MethodDeclaration.java Log Message: Converted MethodDeclaration. Index: methodImplementation.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/methodImplementation.nice,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** methodImplementation.nice 30 Dec 2004 20:58:37 -0000 1.5 --- methodImplementation.nice 2 Jan 2005 02:20:59 -0000 1.6 *************** *** 48,52 **** public Pattern[] getPatterns() = formals; ! boolean hasThis() = notNull(declaration).formalParameters().hasThis(); void buildSymbols() --- 48,52 ---- public Pattern[] getPatterns() = formals; ! boolean hasThis() = notNull(notNull(declaration).formalParameters()).hasThis(); void buildSymbols() *************** *** 106,110 **** void addPatterns() { ! mlsub.typing.Monotype[] parameters = notNull(nice.tools.typing.Types.parameters(notNull(declaration).getType())); for (int i = 0; i < formals.length; i++) if (formals[i].tc == null) --- 106,110 ---- void addPatterns() { ! mlsub.typing.Monotype[] parameters = notNull(nice.tools.typing.Types.parameters(notNull(notNull(declaration).getType()))); for (int i = 0; i < formals.length; i++) if (formals[i].tc == null) Index: niceclass.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/niceclass.nice,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** niceclass.nice 26 Dec 2004 06:21:17 -0000 1.10 --- niceclass.nice 2 Jan 2005 02:20:59 -0000 1.11 *************** *** 389,393 **** for (msym : constructors) { ! let m = msym.getMethodDeclaration(); // Only consider parent methods for which a call from this class --- 389,393 ---- for (msym : constructors) { ! let MethodDeclaration m = cast(msym.getMethodDeclaration()); // Only consider parent methods for which a call from this class *************** *** 436,441 **** for (msym : constructors) { ! let decl = msym.getMethodDeclaration(); ! res.add((decl, decl.formalParameters().getParameters(scope))); } --- 436,441 ---- for (msym : constructors) { ! let MethodDeclaration decl = cast(msym.getMethodDeclaration()); ! res.add((decl, notNull(decl.formalParameters()).getParameters(scope))); } *************** *** 556,568 **** // There might be simpler code to do this, and we could avoid // duplicating the type variables. ! if (parent instanceof JavaMethod && ! parent.getType().isMonomorphic()) specificCst = identifyTypeParameters(cst, parent, typeParameters); notNull(constructorMethod)[i] = new DefaultConstructor ! (new LocatedString("<init>",definition.location()), values, ! specificCst, ! Monotype.resolve(definition.getLocalScope(), values.types()), ! Monotype.sure(new mlsub.typing.MonotypeConstructor(definition.getTC(), definition.getTypeParameters())), ! classe: this, isDefault: true, fields: fields, parent: parent); addConstructor(definition.getTC(), notNull(constructorMethod)[i]); } --- 556,570 ---- // There might be simpler code to do this, and we could avoid // duplicating the type variables. ! if (parent instanceof JavaMethod && ! notNull(parent.getType()).isMonomorphic()) specificCst = identifyTypeParameters(cst, parent, typeParameters); + let cname = new LocatedString("<init>",definition.location()); + let ctype = new mlsub.typing.Polytype(specificCst, new mlsub.typing.FunType(Monotype.resolve(definition.getLocalScope(), values.types()),Monotype.sure(new mlsub.typing.MonotypeConstructor(definition.getTC(), definition.getTypeParameters())))); notNull(constructorMethod)[i] = new DefaultConstructor ! (cname, Node.global, parameters: values, arity: values.size, ! symbol: cast(null), type: ctype, ! classe: this, isDefault: true, fields: fields, parent: parent); ! notNull(constructorMethod)[i].symbol = createMethodSymbol(notNull(constructorMethod)[i], cname, ctype); ! addConstructor(definition.getTC(), notNull(constructorMethod)[i]); } *************** *** 698,705 **** { mlsub.typing.MonotypeConstructor result = ! cast(nice.tools.typing.Types.rawType(method.getType().codomain())); let methodTP = result.getTP(); ! let cst2 = method.getType().getConstraint(); mlsub.typing.Constraint and = mlsub.typing.Constraint.and(cst, cst2); --- 700,707 ---- { mlsub.typing.MonotypeConstructor result = ! cast(nice.tools.typing.Types.rawType(notNull(method.getType()).codomain())); let methodTP = result.getTP(); ! let cst2 = notNull(method.getType()).getConstraint(); mlsub.typing.Constraint and = mlsub.typing.Constraint.and(cst, cst2); Index: retypedMethod.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/retypedMethod.nice,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** retypedMethod.nice 29 Dec 2004 16:31:02 -0000 1.3 --- retypedMethod.nice 2 Jan 2005 02:20:59 -0000 1.4 *************** *** 228,233 **** FormalParameters parameters) { ! return new RetypedJavaMethod(name, constraint, returnType, parameters, ! className: className, methodName: methodName, javaTypes: javaTypes); } --- 228,246 ---- FormalParameters parameters) { ! let res = new RetypedJavaMethod(name, Node.down, ! parameters: parameters, ! syntacticConstraint: constraint.toString(), ! symbol: cast(null), ! arity: parameters.size, ! className: className, ! methodName: methodName, ! javaTypes: javaTypes); ! ! res.addChild(parameters); ! let symbol = createMethodSymbol(res, name, constraint, returnType); ! res.symbol = symbol; ! symbol.propagate = Node.global; ! res.addChild(symbol); ! return res; } Index: niceMethod.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/niceMethod.nice,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** niceMethod.nice 1 Jan 2005 13:10:55 -0000 1.6 --- niceMethod.nice 2 Jan 2005 02:20:59 -0000 1.7 *************** *** 34,38 **** { return name.toString().equals("main") && arity==1 && ! this.getType().domain()[0].toString().equals("java.lang.String[]"); } --- 34,38 ---- { return name.toString().equals("main") && arity==1 && ! notNull(this.getType()).domain()[0].toString().equals("java.lang.String[]"); } *************** *** 95,99 **** for (s : notNull(homonyms)) { ! let d = s.getMethodDeclaration(); // Ignore non-methods. --- 95,99 ---- for (s : notNull(homonyms)) { ! let MethodDeclaration d = cast(s.getMethodDeclaration()); // Ignore non-methods. *************** *** 203,208 **** Contract contract, boolean isOverride) { ! let res = new NiceMethod(name, constraint, returnType, parameters, contract: contract, ! isOverride: isOverride, returnTypeLocation: returnType.location()); return res; } --- 203,220 ---- Contract contract, boolean isOverride) { ! let res = new NiceMethod(name, Node.down, ! parameters: parameters, ! arity: parameters.size, ! syntacticConstraint: constraint.toString(), ! symbol: cast(null), ! contract: contract, ! isOverride: isOverride, ! returnTypeLocation: returnType.location()); ! ! res.addChild(parameters); ! let symbol = createMethodSymbol(res, name, constraint, returnType); ! res.symbol = symbol; ! symbol.propagate = Node.global; ! res.addChild(symbol); return res; } *************** *** 368,372 **** res = nice.tools.code.Gen.createMethod (name, argTypes, retType, def.getSymbols(), true, receiver != null); ! res.parameterCopies = def.formalParameters().getParameterCopies(); // add unique information to disambiguate which method this represents --- 380,384 ---- res = nice.tools.code.Gen.createMethod (name, argTypes, retType, def.getSymbols(), true, receiver != null); ! res.parameterCopies = notNull(def.formalParameters()).getParameterCopies(); // add unique information to disambiguate which method this represents Index: super.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/super.nice,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** super.nice 29 Dec 2004 23:10:48 -0000 1.6 --- super.nice 2 Jan 2005 02:20:59 -0000 1.7 *************** *** 109,113 **** computeType() { ! mlsub.typing.Polytype type = notNull(currentMethod).getDeclaration().getType(); mlsub.typing.FunType monotype; mlsub.typing.Constraint constraint; --- 109,113 ---- computeType() { ! mlsub.typing.Polytype type = notNull(notNull(currentMethod).getDeclaration().getType()); mlsub.typing.FunType monotype; mlsub.typing.Constraint constraint; *************** *** 180,184 **** } ! public ?gnu.bytecode.Method getImplementationAbove(MethodDeclaration /* JavaMethod */ decl, gnu.bytecode.ClassType firstArg) { let thisMethod = decl.getReflectMethod(); --- 180,184 ---- } ! public ?gnu.bytecode.Method getImplementationAbove(JavaMethod decl, gnu.bytecode.ClassType firstArg) { let thisMethod = decl.getReflectMethod(); Index: javaFieldAccess.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/javaFieldAccess.nice,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** javaFieldAccess.nice 1 Jan 2005 16:36:31 -0000 1.3 --- javaFieldAccess.nice 2 Jan 2005 02:20:59 -0000 1.4 *************** *** 111,130 **** Monotype returnType, FormalParameters parameters) { ! return new JavaFieldAccess(name, cst, returnType, parameters, ! className : className, ! fieldName : fieldName ); } ! new JavaFieldAccess(gnu.bytecode.Field field, mlsub.typing.Monotype[?] parameters) { ! this( ! new LocatedString(field.getName(), Location.nowhere()), ! null, ! parameters, ! nice.tools.code.Types.monotype(field.getType(), field.isFinal()), ! field : field, ! className : new LocatedString(field.getDeclaringClass().getName(), Location.nowhere()), ! fieldName : field.getName() ); } --- 111,144 ---- Monotype returnType, FormalParameters parameters) { ! let res = new JavaFieldAccess(name, Node.down, ! parameters: parameters, ! syntacticConstraint: cst.toString(), ! arity: parameters.size, ! symbol: cast(null), ! className : className, ! fieldName : fieldName ); ! res.addChild(parameters); ! let symbol = createMethodSymbol(res, name, cst, returnType); ! res.symbol = symbol; ! symbol.propagate = Node.global; ! res.addChild(symbol); ! return res; } ! JavaFieldAccess createJavaFieldAccess(gnu.bytecode.Field field, mlsub.typing.Monotype[?] parameters) { ! let type = new mlsub.typing.Polytype(null, new mlsub.typing.FunType(parameters, ! nice.tools.code.Types.monotype(field.getType(), field.isFinal()))); ! let res = new JavaFieldAccess(new LocatedString(field.getName(),Location.nowhere()), Node.global, ! parameters: null, ! arity: type.domain().length, ! type: type, ! symbol: cast(null), ! field: field, ! className: new LocatedString(field.getDeclaringClass().getName(), Location.nowhere()), ! fieldName: field.getName() ); ! res.symbol = createMethodSymbol(res, new LocatedString(field.getName(),Location.nowhere()), type); ! return res; } *************** *** 140,144 **** params = null; ! JavaFieldAccess res = new JavaFieldAccess(f, params); if (bossa.util.Debug.javaTypes) --- 154,158 ---- params = null; ! JavaFieldAccess res = createJavaFieldAccess(f, params); if (bossa.util.Debug.javaTypes) Index: nicefieldaccess.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/nicefieldaccess.nice,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** nicefieldaccess.nice 1 Jan 2005 16:36:31 -0000 1.3 --- nicefieldaccess.nice 2 Jan 2005 02:20:59 -0000 1.4 *************** *** 46,58 **** let argType = Monotype.sure(classDef.lowlevelMonotype()); ! return new NiceFieldAccess(field.getName(), ! Constraint.create(classDef.getBinders()), ! field.sym.syntacticType, ! new FormalParameters([new FormalParameters.Parameter(Monotype.create(argType))]), ! field: field); ! } ! private FormalParameters makeList(mlsub.typing.Monotype t) ! { ! return new FormalParameters([new FormalParameters.Parameter(Monotype.create(t))]); } --- 46,63 ---- let argType = Monotype.sure(classDef.lowlevelMonotype()); ! let params = new FormalParameters([new FormalParameters.Parameter(Monotype.create(argType))]); ! let constr = Constraint.create(classDef.getBinders()); ! let res = new NiceFieldAccess(field.getName(), Node.down, ! parameters: params, ! syntacticConstraint: constr.toString(), ! symbol: cast(null), ! arity: 1, ! field: field); ! res.addChild(params); ! let symbol = createMethodSymbol(res, field.getName(), constr, notNull(field.sym.syntacticType)); ! res.symbol = symbol; ! symbol.propagate = Node.global; ! res.addChild(symbol); ! return res; } Index: alternative.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/alternative.nice,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** alternative.nice 30 Dec 2004 18:49:01 -0000 1.5 --- alternative.nice 2 Jan 2005 02:20:59 -0000 1.6 *************** *** 142,146 **** Alternative addDefaultPatterns(MethodDeclaration def) { ! mlsub.typing.Monotype[?] parameters = nice.tools.typing.Types.parameters(def.getType()); Pattern[?] newPatterns = null; --- 142,146 ---- Alternative addDefaultPatterns(MethodDeclaration def) { ! mlsub.typing.Monotype[?] parameters = nice.tools.typing.Types.parameters(notNull(def.getType())); Pattern[?] newPatterns = null; *************** *** 186,190 **** String fullName = to.getFullName(); ! if (from.isJavaMethod()) createJavaAlternative(from).add(fullName); --- 186,190 ---- String fullName = to.getFullName(); ! if (from instanceof JavaMethod) createJavaAlternative(from).add(fullName); *************** *** 348,352 **** { ! Pattern[] patterns = notNull(nice.tools.typing.Types.parameters(method.getType())). mapToArray(mlsub.typing.Monotype param => createPattern(null, nice.tools.typing.Types.concreteConstructor(param), --- 348,352 ---- { ! Pattern[] patterns = notNull(nice.tools.typing.Types.parameters(notNull(method.getType()))). mapToArray(mlsub.typing.Monotype param => createPattern(null, nice.tools.typing.Types.concreteConstructor(param), *************** *** 418,423 **** loc: location); ! alt.add(nice.tools.util.System.split ! (fullName, MethodDeclaration.methodListSeparator)); } catch(UnknownPattern ex) { --- 418,422 ---- loc: location); ! alt.add(nice.tools.util.System.split(fullName, methodListSeparator)); } catch(UnknownPattern ex) { *************** *** 445,452 **** continue; ! MethodDeclaration md = notNull(sym.getMethodDeclaration()); if (md.getFullName().equals(fullName)) { ! md.registerForDispatch(); return; } --- 444,451 ---- continue; ! MethodDeclaration md = cast(sym.getMethodDeclaration()); if (md.getFullName().equals(fullName)) { ! cast(md).registerForDispatch(); return; } Index: inline.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/inline.nice,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** inline.nice 16 Dec 2004 00:30:29 -0000 1.1 --- inline.nice 2 Jan 2005 02:20:59 -0000 1.2 *************** *** 130,131 **** --- 130,152 ---- } } + + public InlinedMethod createInlinedMethod(LocatedString name, + Constraint constraint, Monotype returnType, + FormalParameters parameters, + LocatedString inlineProcedure, String param) + { + let res = new InlinedMethod(name, Node.down, + parameters: parameters, + arity: parameters.size, + syntacticConstraint: constraint.toString(), + symbol: cast(null), + inlineProcedure: inlineProcedure, + parameter: param); + + res.addChild(parameters); + let symbol = createMethodSymbol(res, name, constraint, returnType); + res.symbol = symbol; + symbol.propagate = Node.global; + res.addChild(symbol); + return res; + } Index: constructor.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/constructor.nice,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** constructor.nice 14 Dec 2004 22:49:12 -0000 1.1 --- constructor.nice 2 Jan 2005 02:20:59 -0000 1.2 *************** *** 30,34 **** void addConstructorCallSymbol() { ! let type = new mlsub.typing.Polytype(this.getType().getConstraint(), new mlsub.typing.FunType(this.getArgTypes(), nice.tools.typing.PrimitiveType.voidType)); classe.addConstructorCallSymbol(createConstructorCallSymbol(this, name, type)); --- 30,34 ---- void addConstructorCallSymbol() { ! let type = new mlsub.typing.Polytype(notNull(this.getType()).getConstraint(), new mlsub.typing.FunType(this.getArgTypes(), nice.tools.typing.PrimitiveType.voidType)); classe.addConstructorCallSymbol(createConstructorCallSymbol(this, name, type)); *************** *** 51,55 **** //Arguments where none expected ! if (parameters.size == 0) { res.append(" has no fields. Therefore its constructor takes no arguments."); --- 51,55 ---- //Arguments where none expected ! if (notNull(parameters).size == 0) { res.append(" has no fields. Therefore its constructor takes no arguments."); *************** *** 58,62 **** //No such field ! List<String> nonmatching = notNull(arguments).noMatchByName(parameters); if (!nonmatching.isEmpty()) { --- 58,62 ---- //No such field ! List<String> nonmatching = notNull(arguments).noMatchByName(notNull(parameters)); if (!nonmatching.isEmpty()) { *************** *** 69,73 **** //an explanation of the syntax is necessary res = new StringBuffer(); ! List<FormalParameters.Parameter> missing = notNull(arguments).missingArgs(parameters); List<FormalParameters.Parameter> fieldsToList; --- 69,73 ---- //an explanation of the syntax is necessary res = new StringBuffer(); ! List<FormalParameters.Parameter> missing = notNull(arguments).missingArgs(notNull(parameters)); List<FormalParameters.Parameter> fieldsToList; *************** *** 78,82 **** res.append(this.syntaxExample()) .append("Class ").append(name).append(" has the following fields:\n"); ! fieldsToList = parameters.asList(); } else if (missing.size() > 0) --- 78,82 ---- res.append(this.syntaxExample()) .append("Class ").append(name).append(" has the following fields:\n"); ! fieldsToList = notNull(parameters).asList(); } else if (missing.size() > 0) *************** *** 91,95 **** .append(".\n") .append("The constructor accepts the following arguments:\n" ); ! fieldsToList = parameters.asList(); } for (field : fieldsToList) --- 91,95 ---- .append(".\n") .append("The constructor accepts the following arguments:\n" ); ! fieldsToList = notNull(parameters).asList(); } for (field : fieldsToList) *************** *** 110,114 **** .append(" new ").append(name).append("("); ! let Iterator<FormalParameters.Parameter> params = parameters.getRequiredParameters().iterator(); int paramCount = 0; int len = name.length(); --- 110,114 ---- .append(" new ").append(name).append("("); ! let Iterator<FormalParameters.Parameter> params = notNull(parameters).getRequiredParameters().iterator(); int paramCount = 0; int len = name.length(); Index: customConstructor.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/customConstructor.nice,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** customConstructor.nice 1 Jan 2005 14:38:03 -0000 1.8 --- customConstructor.nice 2 Jan 2005 02:20:59 -0000 1.9 *************** *** 33,37 **** { mlsub.typing.Polytype type = new mlsub.typing.Polytype ! (this.getType().getConstraint(), new mlsub.typing.FunType(this.getArgTypes(), nice.tools.typing.PrimitiveType.voidType)); notNull(classe).addConstructorCallSymbol( --- 33,37 ---- { mlsub.typing.Polytype type = new mlsub.typing.Polytype ! (notNull(this.getType()).getConstraint(), new mlsub.typing.FunType(this.getArgTypes(), nice.tools.typing.PrimitiveType.voidType)); notNull(classe).addConstructorCallSymbol( *************** *** 110,119 **** // as the class definition, even if the source of this custom constructor // renamed them locally. ! let cst = this.getType().getConstraint(); if (mlsub.typing.Constraint.hasBinders(cst)) ! parameters.substitute (this.typeParamMap(notNull(cst).binders(), notNull(classe).getTypeParameters())); ! lambda.addBytecodeAttribute(parameters.asBytecodeAttribute()); initializationCode = new gnu.expr.QuoteExp(new gnu.expr.InitializeProc(lambda)); --- 110,119 ---- // as the class definition, even if the source of this custom constructor // renamed them locally. ! let cst = notNull(this.getType()).getConstraint(); if (mlsub.typing.Constraint.hasBinders(cst)) ! notNull(parameters).substitute (this.typeParamMap(notNull(cst).binders(), notNull(classe).getTypeParameters())); ! lambda.addBytecodeAttribute(notNull(parameters).asBytecodeAttribute()); initializationCode = new gnu.expr.QuoteExp(new gnu.expr.InitializeProc(lambda)); *************** *** 124,128 **** } ! getConstructorInvocation(boolean) { this.getCode(); --- 124,128 ---- } ! getConstructorInvocation(omitDefaults) { this.getCode(); *************** *** 143,150 **** FormalParameters params, Statement body) { ! return new CustomConstructor(new LocatedString("<init>", className.location()), ! cst, getCCReturnType(className, cst), params, contract: noContract, ! className: className, body: body); } --- 143,163 ---- FormalParameters params, Statement body) { ! let name = new LocatedString("<init>", className.location()); ! let returnType = getCCReturnType(className, cst); ! let res = new CustomConstructor(name, Node.down, ! parameters: params, ! arity: params.size, ! syntacticConstraint: cst.toString(), ! symbol: cast(null), ! contract: noContract, ! className: className, ! body: body); + res.addChild(params); + let symbol = createMethodSymbol(res, name, cst, returnType); + res.symbol = symbol; + symbol.propagate = Node.global; + res.addChild(symbol); + return res; } Index: methodbody.nice =================================================================== RCS file: /cvsroot/nice/Nice/src/bossa/syntax/methodbody.nice,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** methodbody.nice 30 Dec 2004 18:49:01 -0000 1.7 --- methodbody.nice 2 Jan 2005 02:20:59 -0000 1.8 *************** *** 85,89 **** } ! MethodDeclaration m = s.getMethodDeclaration(); if (m.isIgnored()) { --- 85,89 ---- } ! MethodDeclaration m = cast(s.getMethodDeclaration()); if (m.isIgnored()) { *************** *** 108,112 **** try{ ! mlsub.typing.Polytype t = m.getType(); mlsub.typing.Constraint.enter(t.getConstraint()); mlsub.typing.Monotype[] domain = t.domain(); --- 108,112 ---- try{ ! mlsub.typing.Polytype t = notNull(m.getType()); mlsub.typing.Constraint.enter(t.getConstraint()); mlsub.typing.Monotype[] domain = t.domain(); *************** *** 151,155 **** for (int m1 = 0; m1 < size; m1++) { ! mlsub.typing.Monotype[] dom1 = tempSymbols[m1].getMethodDeclaration().getType().domain(); for (int m2 = 0; m2 < size; m2++) if (m1 != m2) --- 151,156 ---- for (int m1 = 0; m1 < size; m1++) { ! let MethodDeclaration md1 = cast(tempSymbols[m1].getMethodDeclaration()); ! mlsub.typing.Monotype[] dom1 = notNull(md1.getType()).domain(); for (int m2 = 0; m2 < size; m2++) if (m1 != m2) *************** *** 157,161 **** boolean remove = true; boolean additionalsEqual = true; ! mlsub.typing.Monotype[] dom2 = tempSymbols[m2].getMethodDeclaration().getType().domain(); for (int i = 0; i < len; i++) if (additionalTags[i] != null) --- 158,163 ---- boolean remove = true; boolean additionalsEqual = true; ! let MethodDeclaration md2 = cast(tempSymbols[m2].getMethodDeclaration()); ! mlsub.typing.Monotype[] dom2 = notNull(md2.getType()).domain(); for (int i = 0; i < len; i++) if (additionalTags[i] != null) *************** *** 190,196 **** // Check that the non-dispatched parameter names match the declaration outer: for(let it = symbols.iterator(); it.hasNext();) { ! MethodDeclaration m = it.next().getMethodDeclaration(); if( m instanceof NiceMethod) { ! FormalParameters params = m.formalParameters(); for (int i = params.hasThis() ? 1 : 0; i < formals.length; i++) if (formals[i].atAny() && formals[i].name != null && params.getName(i) != null && --- 192,198 ---- // Check that the non-dispatched parameter names match the declaration outer: for(let it = symbols.iterator(); it.hasNext();) { ! MethodDeclaration m = cast(it.next().getMethodDeclaration()); if( m instanceof NiceMethod) { ! FormalParameters params = notNull(m.formalParameters()); for (int i = params.hasThis() ? 1 : 0; i < formals.length; i++) if (formals[i].atAny() && formals[i].name != null && params.getName(i) != null && *************** *** 223,227 **** for (s : symbols) { ! MethodDeclaration m = s.getMethodDeclaration(); methods += m + " defined " + m.location() + "\n"; } --- 225,229 ---- for (s : symbols) { ! MethodDeclaration m = cast(s.getMethodDeclaration()); methods += m + " defined " + m.location() + "\n"; } *************** *** 269,273 **** User.error(this, name+" is not a method"); ! MethodDeclaration decl = s.getMethodDeclaration(); this.setDeclaration(decl); --- 271,275 ---- User.error(this, name+" is not a method"); ! MethodDeclaration decl = cast(s.getMethodDeclaration()); this.setDeclaration(decl); *************** *** 276,280 **** if (binders != null) { ! let cst = notNull(declaration).getType().getConstraint(); if (! mlsub.typing.Constraint.hasBinders(cst)) User.error(name, "Method " + name + " has no type parameters"); --- 278,282 ---- if (binders != null) { ! let cst = notNull(notNull(declaration).getType()).getConstraint(); if (! mlsub.typing.Constraint.hasBinders(cst)) User.error(name, "Method " + name + " has no type parameters"); *************** *** 312,316 **** boolean entered = false; ! if (mlsub.typing.Constraint.hasBinders(notNull(declaration).getType().getConstraint())) { mlsub.typing.Typing.enter(); --- 314,318 ---- boolean entered = false; ! if (mlsub.typing.Constraint.hasBinders(notNull(notNull(declaration).getType()).getConstraint())) { mlsub.typing.Typing.enter(); *************** *** 320,327 **** try { try { ! mlsub.typing.Constraint.enter(notNull(declaration).getType().getConstraint()); Typing.implies(); ! mlsub.typing.Monotype[] domain = notNull(declaration).getType().domain(); for (int n = 0; n < formals.length; n++) { --- 322,329 ---- try { try { ! mlsub.typing.Constraint.enter(notNull(notNull(declaration).getType()).getConstraint()); Typing.implies(); ! mlsub.typing.Monotype[] domain = notNull(notNull(declaration).getType()).domain(); for (int n = 0; n < formals.length; n++) { *************** *** 353,357 **** try { try { ! mlsub.typing.Constraint.enter(notNull(declaration).getType().getConstraint()); } catch(TypingEx e){ --- 355,359 ---- try { try { ! mlsub.typi... [truncated message content] |