Changeset 4280 for trunk/ProjectFortress/src
- Timestamp:
- 10/22/09 23:51:27 (5 weeks ago)
- Location:
- trunk/ProjectFortress/src/com/sun/fortress
- Files:
-
- 27 modified
-
compiler/OverloadSet.java (modified) (2 diffs)
-
compiler/desugarer/DesugaringVisitor.java (modified) (1 diff)
-
compiler/disambiguator/TypeDisambiguator.java (modified) (3 diffs)
-
compiler/index/Coercion.java (modified) (1 diff)
-
compiler/index/Constructor.java (modified) (3 diffs)
-
compiler/index/DeclaredFunction.java (modified) (1 diff)
-
compiler/index/DeclaredMethod.java (modified) (1 diff)
-
compiler/index/FieldGetterOrSetterMethod.java (modified) (1 diff)
-
compiler/index/Functional.java (modified) (1 diff)
-
compiler/index/FunctionalMethod.java (modified) (1 diff)
-
compiler/typechecker/InferenceVarInserter.java (modified) (2 diffs)
-
compiler/typechecker/TypeAnalyzer.java (modified) (2 diffs)
-
compiler/typechecker/TypeAnalyzerJUTest.java (modified) (1 diff)
-
compiler/typechecker/TypeAnalyzerUtil.java (modified) (1 diff)
-
compiler/typechecker/TypeChecker.java (modified) (5 diffs)
-
nodes_util/ExprFactory.java (modified) (4 diffs)
-
nodes_util/NodeFactory.java (modified) (27 diffs)
-
nodes_util/NodeUtil.java (modified) (3 diffs)
-
parser/Expression.rats (modified) (2 diffs)
-
parser/NoNewlineHeader.rats (modified) (2 diffs)
-
parser/NoNewlineType.rats (modified) (2 diffs)
-
parser/Type.rats (modified) (2 diffs)
-
parser_util/FnHeaderClause.java (modified) (2 diffs)
-
scala_src/typechecker/CoercionOracle.scala (modified) (1 diff)
-
scala_src/typechecker/ExportChecker.scala (modified) (1 diff)
-
syntax_abstractions/phases/Transform.java (modified) (2 diffs)
-
tools/FortressAstToConcrete.java (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ProjectFortress/src/com/sun/fortress/compiler/OverloadSet.java
r4254 r4280 77 77 } 78 78 79 public List< BaseType> thrownTypes() {79 public List<Type> thrownTypes() { 80 80 return tagF.thrownTypes(); 81 81 } … … 789 789 HashSet<Type> exceptions = new HashSet<Type>(); 790 790 for (TaggedFunctionName f : lessSpecificThanSoFar) { 791 List< BaseType> f_exceptions = f.thrownTypes();791 List<Type> f_exceptions = f.thrownTypes(); 792 792 exceptions.addAll(f_exceptions); 793 793 } -
trunk/ProjectFortress/src/com/sun/fortress/compiler/desugarer/DesugaringVisitor.java
r4096 r4280 591 591 List<StaticParam> staticParams_result = recurOnListOfStaticParam(header.getStaticParams()); 592 592 Option<WhereClause> where_result = recurOnOptionOfWhereClause(header.getWhereClause()); 593 Option<List< BaseType>> throwsClause_result = recurOnOptionOfListOfBaseType(header.getThrowsClause());593 Option<List<Type>> throwsClause_result = recurOnOptionOfListOfType(header.getThrowsClause()); 594 594 Option<Contract> contract_result = recurOnOptionOfContract(header.getContract()); 595 595 List<Param> params_result = recurOnListOfParam(header.getParams()); -
trunk/ProjectFortress/src/com/sun/fortress/compiler/disambiguator/TypeDisambiguator.java
r4275 r4280 94 94 (Id) NodeUtil.getName(that).accept(v), 95 95 v.recurOnOptionOfWhereClause(NodeUtil.getWhereClause(that)), 96 Option.<List< BaseType>>none(),96 Option.<List<Type>>none(), 97 97 Option.<Contract>none(), 98 98 v.recurOnListOfTraitTypeWhere(NodeUtil.getExtendsClause(that)), … … 118 118 (Id) NodeUtil.getName(that).accept(v), 119 119 v.recurOnOptionOfWhereClause(NodeUtil.getWhereClause(that)), 120 Option.<List< BaseType>>none(),120 Option.<List<Type>>none(), 121 121 Option.<Contract>none(), 122 122 v.recurOnListOfTraitTypeWhere(NodeUtil.getExtendsClause(that)), … … 142 142 (IdOrOpOrAnonymousName) NodeUtil.getName(that).accept(v), 143 143 v.recurOnOptionOfWhereClause(NodeUtil.getWhereClause(that)), 144 v.recurOnOptionOfListOf BaseType(NodeUtil.getThrowsClause(that)),144 v.recurOnOptionOfListOfType(NodeUtil.getThrowsClause(that)), 145 145 v.recurOnOptionOfContract(NodeUtil.getContract(that)), 146 146 v.recurOnListOfParam(NodeUtil.getParams(that)), -
trunk/ProjectFortress/src/com/sun/fortress/compiler/index/Coercion.java
r4211 r4280 154 154 155 155 @Override 156 public List< BaseType> thrownTypes() {156 public List<Type> thrownTypes() { 157 157 if (NodeUtil.getThrowsClause(_ast).isNone()) return Collections.emptyList(); 158 158 else return Collections.unmodifiableList(NodeUtil.getThrowsClause(_ast).unwrap()); -
trunk/ProjectFortress/src/com/sun/fortress/compiler/index/Constructor.java
r4172 r4280 35 35 private final List<StaticParam> _staticParams; 36 36 private final Option<List<Param>> _params; 37 private final Option<List< BaseType>> _throwsClause;37 private final Option<List<Type>> _throwsClause; 38 38 private final Option<WhereClause> _where; 39 39 40 public Constructor(Id declaringTrait, List<StaticParam> staticParams, Option<List<Param>> params, Option<List< BaseType>> throwsClause, Option<WhereClause> where) {40 public Constructor(Id declaringTrait, List<StaticParam> staticParams, Option<List<Param>> params, Option<List<Type>> throwsClause, Option<WhereClause> where) { 41 41 _declaringTrait = declaringTrait; 42 42 _staticParams = staticParams; … … 59 59 _staticParams = visitor.recurOnListOfStaticParam(that._staticParams); 60 60 _params = visitor.recurOnOptionOfListOfParam(that._params); 61 _throwsClause = visitor.recurOnOptionOfListOf BaseType(that._throwsClause);61 _throwsClause = visitor.recurOnOptionOfListOfType(that._throwsClause); 62 62 _where = visitor.recurOnOptionOfWhereClause(that._where); 63 63 … … 117 117 118 118 @Override 119 public List< BaseType> thrownTypes() {119 public List<Type> thrownTypes() { 120 120 if (_throwsClause.isNone()) return Collections.emptyList(); 121 121 else return Collections.unmodifiableList(_throwsClause.unwrap()); -
trunk/ProjectFortress/src/com/sun/fortress/compiler/index/DeclaredFunction.java
r4172 r4280 98 98 99 99 @Override 100 public List< BaseType> thrownTypes() {100 public List<Type> thrownTypes() { 101 101 if (NodeUtil.getThrowsClause(_ast).isNone()) return Collections.emptyList(); 102 102 else return Collections.unmodifiableList(NodeUtil.getThrowsClause(_ast).unwrap()); -
trunk/ProjectFortress/src/com/sun/fortress/compiler/index/DeclaredMethod.java
r4172 r4280 94 94 95 95 @Override 96 public List< BaseType> thrownTypes() {96 public List<Type> thrownTypes() { 97 97 if (NodeUtil.getThrowsClause(_ast).isNone()) return Collections.emptyList(); 98 98 else return Collections.unmodifiableList(NodeUtil.getThrowsClause(_ast).unwrap()); -
trunk/ProjectFortress/src/com/sun/fortress/compiler/index/FieldGetterOrSetterMethod.java
r4172 r4280 98 98 99 99 @Override 100 public List< BaseType> thrownTypes() {100 public List<Type> thrownTypes() { 101 101 return Collections.emptyList(); 102 102 } -
trunk/ProjectFortress/src/com/sun/fortress/compiler/index/Functional.java
r4172 r4280 36 36 public abstract List<Param> parameters(); 37 37 38 public abstract List< BaseType> thrownTypes();38 public abstract List<Type> thrownTypes(); 39 39 40 40 public abstract Modifiers mods(); -
trunk/ProjectFortress/src/com/sun/fortress/compiler/index/FunctionalMethod.java
r4217 r4280 145 145 146 146 @Override 147 public List< BaseType> thrownTypes() {147 public List<Type> thrownTypes() { 148 148 if (NodeUtil.getThrowsClause(_ast).isNone()) return Collections.emptyList(); 149 149 else return Collections.unmodifiableList(NodeUtil.getThrowsClause(_ast).unwrap()); -
trunk/ProjectFortress/src/com/sun/fortress/compiler/typechecker/InferenceVarInserter.java
r3783 r4280 68 68 List<StaticParam> staticParams_result = recurOnListOfStaticParam(header.getStaticParams()); 69 69 Option<WhereClause> where_result = recurOnOptionOfWhereClause(header.getWhereClause()); 70 Option<List< BaseType>> throwsClause_result = recurOnOptionOfListOfBaseType(header.getThrowsClause());70 Option<List<Type>> throwsClause_result = recurOnOptionOfListOfType(header.getThrowsClause()); 71 71 Option<Contract> contract_result = recurOnOptionOfContract(header.getContract()); 72 72 List<Param> params_result = recurOnListOfParam(header.getParams()); … … 86 86 List<StaticParam> staticParams_result, List<Param> params_result, 87 87 Option<Type> returnType_result, 88 Option<List< BaseType>> throwsClause_result,88 Option<List<Type>> throwsClause_result, 89 89 Option<WhereClause> where_result, 90 90 Option<Contract> contract_result, -
trunk/ProjectFortress/src/com/sun/fortress/compiler/typechecker/TypeAnalyzer.java
r4254 r4280 399 399 @Override public Effect forEffectOnly(Effect e, 400 400 ASTNodeInfo info_result, 401 Option<List< BaseType>> normalThrows) {401 Option<List<Type>> normalThrows) { 402 402 if (normalThrows.isNone()) { return e; } 403 403 else { 404 List< BaseType> reduced = reduceDisjuncts(normalThrows.unwrap(),404 List<Type> reduced = reduceDisjuncts(normalThrows.unwrap(), 405 405 _emptyHistory); 406 406 if (reduced.isEmpty()) { return NodeFactory.makeEffect(NodeFactory.makeSpan(e), e.isIoEffect()); } … … 1164 1164 private ConstraintFormula sub(Effect s, Effect t, SubtypeHistory h) { 1165 1165 if (!s.isIoEffect() || t.isIoEffect()) { 1166 List< BaseType> empty = Collections.<BaseType>emptyList();1167 Type sThrows = makeUnion( IterUtil.<Type>relax(s.getThrowsClause().unwrap(empty)));1168 Type tThrows = makeUnion( IterUtil.<Type>relax(s.getThrowsClause().unwrap(empty)));1166 List<Type> empty = Collections.<Type>emptyList(); 1167 Type sThrows = makeUnion(s.getThrowsClause().unwrap(empty)); 1168 Type tThrows = makeUnion(s.getThrowsClause().unwrap(empty)); 1169 1169 return sub(sThrows, tThrows, h); 1170 1170 } -
trunk/ProjectFortress/src/com/sun/fortress/compiler/typechecker/TypeAnalyzerJUTest.java
r3963 r4280 649 649 if (s.startsWith("{")) { elts = splitList(s, "{", "}"); } 650 650 else { elts = Collections.singletonList(s); } 651 List< BaseType> ts = new LinkedList<BaseType>();651 List<Type> ts = new LinkedList<Type>(); 652 652 for (String elt : elts) { 653 653 Type t = parseType(elt); 654 if (!(t instanceof BaseType)) { 655 throw new IllegalArgumentException("Non-BaseType in throws: " + t); 656 } 657 ts.add((BaseType) t); 654 ts.add( t); 658 655 } 659 656 return NodeFactory.makeEffect(span, Option.some(ts), io); -
trunk/ProjectFortress/src/com/sun/fortress/compiler/typechecker/TypeAnalyzerUtil.java
r3538 r4280 174 174 recurOnKeywords(_d.getKeywords()) || 175 175 t.getRange().accept(this) || 176 recurOnList(t.getEffect().getThrowsClause().unwrap(Collections.< BaseType>emptyList()));176 recurOnList(t.getEffect().getThrowsClause().unwrap(Collections.<Type>emptyList())); 177 177 } else 178 178 return d.accept(this) || 179 179 t.getRange().accept(this) || 180 recurOnList(t.getEffect().getThrowsClause().unwrap(Collections.< BaseType>emptyList()));180 recurOnList(t.getEffect().getThrowsClause().unwrap(Collections.<Type>emptyList())); 181 181 } 182 182 @Override public Boolean forTupleType(TupleType t) { -
trunk/ProjectFortress/src/com/sun/fortress/compiler/typechecker/TypeChecker.java
r4275 r4280 2392 2392 List<TypeCheckerResult> all_results = new ArrayList<TypeCheckerResult>(); 2393 2393 2394 Option<List<TypeCheckerResult>> throwsClause_result = recurOnOptionOfListOf BaseType(NodeUtil.getThrowsClause(that));2394 Option<List<TypeCheckerResult>> throwsClause_result = recurOnOptionOfListOfType(NodeUtil.getThrowsClause(that)); 2395 2395 2396 2396 … … 2458 2458 // All throws types must be a subtype of exception 2459 2459 if( NodeUtil.getThrowsClause(that).isSome() ) { 2460 for( BaseType exn : NodeUtil.getThrowsClause(that).unwrap() ) {2460 for( Type exn : NodeUtil.getThrowsClause(that).unwrap() ) { 2461 2461 all_results.add(this.checkSubtype(exn, Types.CHECKED_EXCEPTION, that, 2462 2462 "Types in throws clause must be subtypes of CheckedException, but "+ … … 2475 2475 (Option<Type>)TypeCheckerResult.astFromResult(returnType_result), 2476 2476 NodeUtil.getWhereClause(that), 2477 (Option<List< BaseType>>)TypeCheckerResult.astFromResults(throwsClause_result),2477 (Option<List<Type>>)TypeCheckerResult.astFromResults(throwsClause_result), 2478 2478 (Expr)body_result.ast() ); 2479 2479 … … 3548 3548 } 3549 3549 Option<List<TypeCheckerResult>> paramsResult = checker_with_sparams.recurOnOptionOfListOfParam(NodeUtil.getParams(that)); 3550 Option<List<TypeCheckerResult>> throwsClauseResult = checker_with_sparams.recurOnOptionOfListOf BaseType(NodeUtil.getThrowsClause(that));3550 Option<List<TypeCheckerResult>> throwsClauseResult = checker_with_sparams.recurOnOptionOfListOfType(NodeUtil.getThrowsClause(that)); 3551 3551 3552 3552 TypeChecker method_checker = checker_with_sparams; … … 3623 3623 (List<Decl>)TypeCheckerResult.astFromResults(decls_result), 3624 3624 (Option<List<Param>>)TypeCheckerResult.astFromResults(paramsResult), 3625 (Option<List< BaseType>>)TypeCheckerResult.astFromResults(throwsClauseResult),3625 (Option<List<Type>>)TypeCheckerResult.astFromResults(throwsClauseResult), 3626 3626 contract, 3627 3627 that.getSelfType()); -
trunk/ProjectFortress/src/com/sun/fortress/nodes_util/ExprFactory.java
r4196 r4280 768 768 Expr body) { 769 769 return makeFnExpr(span, params, Option.<Type>none(), 770 Option.<List< BaseType>>none(), body);770 Option.<List<Type>>none(), body); 771 771 } 772 772 … … 774 774 Option<Type> returnType, Expr body) { 775 775 return makeFnExpr(span, params, returnType, 776 Option.<List< BaseType>>none(), body);776 Option.<List<Type>>none(), body); 777 777 } 778 778 779 779 public static FnExpr makeFnExpr(Span span, List<Param> params, 780 780 Option<Type> returnType, 781 Option<List< BaseType>> throwsClause,781 Option<List<Type>> throwsClause, 782 782 Expr body) { 783 783 return makeFnExpr(span, false, Option.<Type>none(), … … 796 796 Option<Type> returnType, 797 797 Option<WhereClause> whereClause, 798 Option<List< BaseType>> throwsClause,798 Option<List<Type>> throwsClause, 799 799 Expr body) { 800 800 FnHeader header = NodeFactory.makeFnHeader(Modifiers.None, name, staticParams, … … 1018 1018 staticParams, 1019 1019 Option.<WhereClause>none(), 1020 Option.<List< BaseType>>none(),1020 Option.<List<Type>>none(), 1021 1021 Option.<Contract>none(), 1022 1022 extendsC, decls); -
trunk/ProjectFortress/src/com/sun/fortress/nodes_util/NodeFactory.java
r4275 r4280 331 331 Option<Type> selfType) { 332 332 TraitTypeHeader header = makeTraitTypeHeader(mods, name, sparams, whereC, 333 Option.<List< BaseType>>none(),333 Option.<List<Type>>none(), 334 334 Option.<Contract>none(), 335 335 extendsC, decls); … … 354 354 extendsC, Option.<WhereClause>none(), decls, 355 355 Option.<List<Param>>none(), 356 Option.<List< BaseType>>none(),356 Option.<List<Type>>none(), 357 357 Option.<Contract>none(), 358 358 selfType); … … 367 367 Option.<WhereClause>none(), 368 368 Collections.<Decl>emptyList(), params, 369 Option.<List< BaseType>>none(),369 Option.<List<Type>>none(), 370 370 Option.<Contract>none(), 371 371 selfType); … … 382 382 Option.<WhereClause>none(), decls, 383 383 params, 384 Option.<List< BaseType>>none(),384 Option.<List<Type>>none(), 385 385 Option.<Contract>none(),selfType); 386 386 } … … 396 396 Collections.<Decl>emptyList(), 397 397 Option.<List<Param>>none(), 398 Option.<List< BaseType>>none(),398 Option.<List<Type>>none(), 399 399 Option.<Contract>none(), 400 400 Option.<Type>some(selfType)); … … 407 407 List<Decl> decls, 408 408 Option<List<Param>> params, 409 Option<List< BaseType>> throwsC,409 Option<List<Type>> throwsC, 410 410 Option<Contract> contract, 411 411 Option<Type> selfType) { … … 418 418 public static FnDecl mkFnDecl(Span span, Modifiers mods, 419 419 FnHeaderFront fhf, FnHeaderClause fhc) { 420 Option<List< BaseType>> throws_ = fhc.getThrowsClause();420 Option<List<Type>> throws_ = fhc.getThrowsClause(); 421 421 Option<WhereClause> where_ = fhc.getWhereClause(); 422 422 Option<Contract> contract = fhc.getContractClause(); … … 432 432 List<Param> params, 433 433 FnHeaderClause fhc) { 434 Option<List< BaseType>> throws_ = fhc.getThrowsClause();434 Option<List<Type>> throws_ = fhc.getThrowsClause(); 435 435 Option<WhereClause> where_ = fhc.getWhereClause(); 436 436 Option<Contract> contract = fhc.getContractClause(); … … 450 450 FnHeaderFront fhf, 451 451 FnHeaderClause fhc, Expr expr) { 452 Option<List< BaseType>> throws_ = fhc.getThrowsClause();452 Option<List<Type>> throws_ = fhc.getThrowsClause(); 453 453 Option<WhereClause> where_ = fhc.getWhereClause(); 454 454 Option<Contract> contract = fhc.getContractClause(); … … 462 462 List<StaticParam> sparams, List<Param> params, 463 463 FnHeaderClause fhc, Option<Expr> expr) { 464 Option<List< BaseType>> throws_ = fhc.getThrowsClause();464 Option<List<Type>> throws_ = fhc.getThrowsClause(); 465 465 Option<WhereClause> where_ = fhc.getWhereClause(); 466 466 Option<Contract> contract = fhc.getContractClause(); … … 476 476 Option<Type> returnType) { 477 477 return makeFnDecl(span, mods, name, staticParams, params, returnType, 478 Option.<List< BaseType>>none(),478 Option.<List<Type>>none(), 479 479 Option.<WhereClause>none(), 480 480 Option.<Contract>none()); … … 489 489 Collections.<StaticParam>emptyList(), 490 490 params, returnType, 491 Option.<List< BaseType>>none(),491 Option.<List<Type>>none(), 492 492 Option.<WhereClause>none(), 493 493 Option.<Contract>none(), … … 500 500 List<Param> params, 501 501 Option<Type> returnType, 502 Option<List< BaseType>> throwsC,502 Option<List<Type>> throwsC, 503 503 Option<WhereClause> whereC, 504 504 Option<Contract> contract) { … … 519 519 List<Param> params, 520 520 Option<Type> returnType, 521 Option<List< BaseType>> throwsC,521 Option<List<Type>> throwsC, 522 522 Option<WhereClause> whereC, 523 523 Option<Contract> contract, … … 538 538 List<StaticParam> staticParams, 539 539 Option<WhereClause> whereClause, 540 Option<List< BaseType>> throwsClause,540 Option<List<Type>> throwsClause, 541 541 Option<Contract> contract, 542 542 List<Param> params, … … 551 551 List<Param> params, 552 552 Option<Type> returnType, 553 Option<List< BaseType>> throwsC,553 Option<List<Type>> throwsC, 554 554 Option<WhereClause> whereC, 555 555 Option<Contract> contract, … … 1174 1174 1175 1175 public static Effect makeEffect(Span span) { 1176 return makeEffect(span, Option.<List< BaseType>>none(), false);1177 } 1178 1179 public static Effect makeEffect(List< BaseType> throwsClause) {1176 return makeEffect(span, Option.<List<Type>>none(), false); 1177 } 1178 1179 public static Effect makeEffect(List<Type> throwsClause) { 1180 1180 Span span; 1181 1181 if ( throwsClause.isEmpty() ) { … … 1188 1188 } 1189 1189 1190 public static Effect makeEffect(SourceLoc defaultLoc, List< BaseType> throwsClause) {1190 public static Effect makeEffect(SourceLoc defaultLoc, List<Type> throwsClause) { 1191 1191 return makeEffect(NodeUtil.spanAll(defaultLoc, throwsClause), 1192 1192 Option.some(throwsClause), false); 1193 1193 } 1194 1194 1195 public static Effect makeEffect(Option<List< BaseType>> throwsClause) {1195 public static Effect makeEffect(Option<List<Type>> throwsClause) { 1196 1196 Span span; 1197 1197 if ( throwsClause.isNone() ) … … 1206 1206 } 1207 1207 1208 public static Effect makeEffect(SourceLoc defaultLoc, Option<List< BaseType>> throwsClause) {1208 public static Effect makeEffect(SourceLoc defaultLoc, Option<List<Type>> throwsClause) { 1209 1209 Span span = NodeUtil.spanAll(defaultLoc, 1210 throwsClause.unwrap(Collections.< BaseType>emptyList()));1210 throwsClause.unwrap(Collections.<Type>emptyList())); 1211 1211 return makeEffect(span, throwsClause, false); 1212 1212 } 1213 1213 1214 1214 public static Effect makeEffect(Span span, boolean ioEffect) { 1215 return makeEffect(span, Option.<List< BaseType>>none(), ioEffect);1216 } 1217 1218 1219 public static Effect makeEffect(Span span, Option<List< BaseType>> throwsC,1215 return makeEffect(span, Option.<List<Type>>none(), ioEffect); 1216 } 1217 1218 1219 public static Effect makeEffect(Span span, Option<List<Type>> throwsC, 1220 1220 boolean ioEffect) { 1221 1221 return new Effect(makeSpanInfo(span), throwsC, ioEffect); … … 1545 1545 Collections.<StaticParam>emptyList(), 1546 1546 Option.<WhereClause>none(), 1547 Option.<List< BaseType>>none(), Option.<Contract>none(),1547 Option.<List<Type>>none(), Option.<Contract>none(), 1548 1548 extendsClause, decls); 1549 1549 } … … 1553 1553 List<StaticParam> staticParams, 1554 1554 Option<WhereClause> whereClause, 1555 Option<List< BaseType>> throwsClause,1555 Option<List<Type>> throwsClause, 1556 1556 Option<Contract> contract, 1557 1557 List<TraitTypeWhere> extendsClause, … … 2406 2406 public static FnHeaderClause makeFnClauses(BufferedWriter writer, Span span, 2407 2407 List<FnHeaderClause> clauses) { 2408 Option<List< BaseType>> throwsC = Option.<List<BaseType>>none();2408 Option<List<Type>> throwsC = Option.<List<Type>>none(); 2409 2409 Option<WhereClause> whereC = Option.<WhereClause>none(); 2410 2410 Option<List<Expr>> requiresC = Option.<List<Expr>>none(); … … 2473 2473 } 2474 2474 2475 public static FnHeaderClause makeThrowsClause(Option<List< BaseType>> throwsC) {2475 public static FnHeaderClause makeThrowsClause(Option<List<Type>> throwsC) { 2476 2476 return makeFnHeaderClause(throwsC, Option.<WhereClause>none(), 2477 2477 Option.<Contract>none(), Option.<Type>none()); … … 2479 2479 2480 2480 public static FnHeaderClause makeWhereClause(Option<WhereClause> whereC) { 2481 return makeFnHeaderClause(Option.<List< BaseType>>none(), whereC,2481 return makeFnHeaderClause(Option.<List<Type>>none(), whereC, 2482 2482 Option.<Contract>none(), Option.<Type>none()); 2483 2483 } 2484 2484 2485 2485 public static FnHeaderClause makeRequiresClause(Option<List<Expr>> requiresC) { 2486 return makeFnHeaderClause(Option.<List< BaseType>>none(),2486 return makeFnHeaderClause(Option.<List<Type>>none(), 2487 2487 Option.<WhereClause>none(), 2488 2488 Option.<Contract>some(makeContract(parserSpan, requiresC, … … 2493 2493 2494 2494 public static FnHeaderClause makeEnsuresClause(Option<List<EnsuresClause>> ensuresC) { 2495 return makeFnHeaderClause(Option.<List< BaseType>>none(),2495 return makeFnHeaderClause(Option.<List<Type>>none(), 2496 2496 Option.<WhereClause>none(), 2497 2497 Option.<Contract>some(makeContract(parserSpan, Option.<List<Expr>>none(), … … 2501 2501 2502 2502 public static FnHeaderClause makeInvariantsClause(Option<List<Expr>> invariantsC) { 2503 return makeFnHeaderClause(Option.<List< BaseType>>none(),2503 return makeFnHeaderClause(Option.<List<Type>>none(), 2504 2504 Option.<WhereClause>none(), 2505 2505 Option.<Contract>some(makeContract(parserSpan, … … 2510 2510 } 2511 2511 2512 public static FnHeaderClause makeFnHeaderClause(Option<List< BaseType>> throwsC,2512 public static FnHeaderClause makeFnHeaderClause(Option<List<Type>> throwsC, 2513 2513 Option<WhereClause> whereC, 2514 2514 Option<Contract> contractC, -
trunk/ProjectFortress/src/com/sun/fortress/nodes_util/NodeUtil.java
r4275 r4280 255 255 } 256 256 257 public static Option<List< BaseType>> getThrowsClause(ObjectDecl o) {257 public static Option<List<Type>> getThrowsClause(ObjectDecl o) { 258 258 return o.getHeader().getThrowsClause(); 259 259 } … … 337 337 } 338 338 339 public static Option<List< BaseType>> getThrowsClause(FnDecl f) {339 public static Option<List<Type>> getThrowsClause(FnDecl f) { 340 340 return f.getHeader().getThrowsClause(); 341 341 } … … 366 366 } 367 367 368 public static Option<List< BaseType>> getThrowsClause(FnExpr f) {368 public static Option<List<Type>> getThrowsClause(FnExpr f) { 369 369 return f.getHeader().getThrowsClause(); 370 370 } -
trunk/ProjectFortress/src/com/sun/fortress/parser/Expression.rats
r4057 r4280 58 58 Useful.list(NodeFactory.makeParam(a1)), 59 59 Option.<Type>none(), 60 Option.<List< BaseType>>wrap(a2), a3);60 Option.<List<Type>>wrap(a2), a3); 61 61 } 62 62 / <Fn2> fn w openparen a1:(w Params)? w closeparen a2:(w IsType)? a3:(w Throws)? w match w a4:Expr … … 64 64 yyValue = ExprFactory.makeFnExpr(createSpan(yyStart,yyCount), a1, 65 65 Option.<Type>wrap(a2), 66 Option.<List< BaseType>>wrap(a3), a4);66 Option.<List<Type>>wrap(a3), a4); 67 67 } 68 68 / <ErrorProduction1> fn w a1:ValParam a2:(w IsType)? a3:(w Throws)? w match w a4:Expr -
trunk/ProjectFortress/src/com/sun/fortress/parser/NoNewlineHeader.rats
r4275 r4280 202 202 FnHeaderClause FnClause = 203 203 w a1:Throws 204 { yyValue = NodeFactory.makeThrowsClause(Option.<List< BaseType>>some(a1)); }204 { yyValue = NodeFactory.makeThrowsClause(Option.<List<Type>>some(a1)); } 205 205 / w a1:Where 206 206 { yyValue = NodeFactory.makeWhereClause(Option.<WhereClause>some(a1)); } … … 219 219 /* Throws ::= throws w MayTraitTypes */ 220 220 /* MayTraitTypes ::= { w } | TraitTypes */ 221 List< BaseType> Throws =221 List<Type> Throws = 222 222 throws w opencurly w closecurly 223 { yyValue = Collections.< BaseType>emptyList(); }223 { yyValue = Collections.<Type>emptyList(); } 224 224 / throws w TraitTypes ; 225 225 -
trunk/ProjectFortress/src/com/sun/fortress/parser/NoNewlineType.rats
r3875 r4280 89 89 PureList<PostfixOpExpr> TightInfixPostfix := ... 90 90 / <Arrow> a1:TypeInfixOp a2:TypePrimary a3:(s Throws)? 91 { yyValue = a2.cons((PostfixOpExpr)new TightInfix(a1, NodeFactory.makeEffect(Option.<List< BaseType>>wrap(a3)))); }91 { yyValue = a2.cons((PostfixOpExpr)new TightInfix(a1, NodeFactory.makeEffect(Option.<List<Type>>wrap(a3)))); } 92 92 / <ArrowPrefix> a1:TypeInfixOp a2:TypePrefix a3:(s Throws)? 93 { yyValue = a2.cons((PostfixOpExpr)new TightInfix(a1, NodeFactory.makeEffect(Option.<List< BaseType>>wrap(a3)))); }93 { yyValue = a2.cons((PostfixOpExpr)new TightInfix(a1, NodeFactory.makeEffect(Option.<List<Type>>wrap(a3)))); } 94 94 / <Postfix> a1:DimPostfixOp sr a2:TypePrimary 95 95 { yyValue = a2.cons((PostfixOpExpr)new Postfix(a1)); } … … 105 105 PureList<PostfixOpExpr> LooseInfix := ... 106 106 / <Arrow> a1:TypeInfixOp sr a2:TypePrimary a3:(s Throws)? 107 { yyValue = a2.cons((PostfixOpExpr)new LooseInfix(a1, NodeFactory.makeEffect(Option.<List< BaseType>>wrap(a3)))); }107 { yyValue = a2.cons((PostfixOpExpr)new LooseInfix(a1, NodeFactory.makeEffect(Option.<List<Type>>wrap(a3)))); } 108 108 / <ArrowPrefix> a1:TypeInfixOp sr a2:TypePrefix a3:(s Throws)? 109 { yyValue = a2.cons((PostfixOpExpr)new LooseInfix(a1, NodeFactory.makeEffect(Option.<List< BaseType>>wrap(a3)))); }109 { yyValue = a2.cons((PostfixOpExpr)new LooseInfix(a1, NodeFactory.makeEffect(Option.<List<Type>>wrap(a3)))); } 110 110 / <Infix> a1:DimInfixOp sr a2:TypePrimary 111 111 { yyValue = a2.cons((PostfixOpExpr)new LooseInfix(a1)); } -
trunk/ProjectFortress/src/com/sun/fortress/parser/Type.rats
r3875 r4280 104 104 PureList<PostfixOpExpr> TightInfixPostfix = 105 105 <Arrow> a1:TypeInfixOp a2:TypePrimary a3:(w Throws)? 106 { yyValue = a2.cons((PostfixOpExpr)new TightInfix(a1, NodeFactory.makeEffect(Option.<List< BaseType>>wrap(a3)))); }106 { yyValue = a2.cons((PostfixOpExpr)new TightInfix(a1, NodeFactory.makeEffect(Option.<List<Type>>wrap(a3)))); } 107 107 / <ArrowPrefix> a1:TypeInfixOp a2:TypePrefix a3:(w Throws)? 108 { yyValue = a2.cons((PostfixOpExpr)new TightInfix(a1, NodeFactory.makeEffect(Option.<List< BaseType>>wrap(a3)))); }108 { yyValue = a2.cons((PostfixOpExpr)new TightInfix(a1, NodeFactory.makeEffect(Option.<List<Type>>wrap(a3)))); } 109 109 / a1:DimInfixOp a2:TypePrimary 110 110 { yyValue = a2.cons((PostfixOpExpr)new TightInfix(a1)); } … … 126 126 PureList<PostfixOpExpr> LooseInfix = 127 127 <Arrow> a1:TypeInfixOp wr a2:TypePrimary a3:(w Throws)? 128 { yyValue = a2.cons((PostfixOpExpr)new LooseInfix(a1, NodeFactory.makeEffect(Option.<List< BaseType>>wrap(a3)))); }128 { yyValue = a2.cons((PostfixOpExpr)new LooseInfix(a1, NodeFactory.makeEffect(Option.<List<Type>>wrap(a3)))); } 129 129 / <ArrowPrefix> a1:TypeInfixOp wr a2:TypePrefix a3:(w Throws)? 130 { yyValue = a2.cons((PostfixOpExpr)new LooseInfix(a1, NodeFactory.makeEffect(Option.<List< BaseType>>wrap(a3)))); }130 { yyValue = a2.cons((PostfixOpExpr)new LooseInfix(a1, NodeFactory.makeEffect(Option.<List<Type>>wrap(a3)))); } 131 131 / <Infix> a1:DimInfixOp wr a2:TypePrimary 132 132 { yyValue = a2.cons((PostfixOpExpr)new LooseInfix(a1)); } -
trunk/ProjectFortress/src/com/sun/fortress/parser_util/FnHeaderClause.java
r4002 r4280 33 33 public class FnHeaderClause { 34 34 35 private Option<List< BaseType>> throwsClause;35 private Option<List<Type>> throwsClause; 36 36 private Option<WhereClause> whereClause; 37 37 private Option<Contract> contractClause; 38 38 private Option<Type> returnType; 39 39 40 public FnHeaderClause(Option<List< BaseType>> throwsClause,40 public FnHeaderClause(Option<List<Type>> throwsClause, 41 41 Option<WhereClause> whereClause, 42 42 Option<Contract> contractClause, … … 48 48 } 49 49 50 public Option<List< BaseType>> getThrowsClause() {50 public Option<List<Type>> getThrowsClause() { 51 51 return throwsClause; 52 52 } -
trunk/ProjectFortress/src/com/sun/fortress/scala_src/typechecker/CoercionOracle.scala
r4251 r4280 270 270 val (SArrowType(_, a, b, teff, _, _), SArrowType(_, d, e, ueff, _, _)) = (t, u) 271 271 // Get throws types. 272 val c = toOption(teff.getThrowsClause).map(toList[ BaseType]).getOrElse(List[BaseType]())273 val f = toOption(ueff.getThrowsClause).map(toList[ BaseType]).getOrElse(List[BaseType]())272 val c = toOption(teff.getThrowsClause).map(toList[Type]).getOrElse(List[Type]()) 273 val f = toOption(ueff.getThrowsClause).map(toList[Type]).getOrElse(List[Type]()) 274 274 275 275 // 1. A -> B throws C is not a subtype of D -> E throws F -
trunk/ProjectFortress/src/com/sun/fortress/scala_src/typechecker/ExportChecker.scala
r4094 r4280 758 758 def apply(id:Id, staticParams: JavaList[StaticParam], 759 759 params: JavaOption[JavaList[Param]], 760 throwsClause: JavaOption[JavaList[ BaseType]],760 throwsClause: JavaOption[JavaList[Type]], 761 761 where: JavaOption[WhereClause]) = 762 762 new JavaConstructor(id, staticParams, params, throwsClause, where) -
trunk/ProjectFortress/src/com/sun/fortress/syntax_abstractions/phases/Transform.java
r4185 r4280 336 336 Option<Type> returnType_result = recurOnOptionOfType(NodeUtil.getReturnType(that)); 337 337 Option<WhereClause> where_result = recurOnOptionOfWhereClause(NodeUtil.getWhereClause(that)); 338 Option<List< BaseType>> throwsClause_result = recurOnOptionOfListOfBaseType(NodeUtil.getThrowsClause(that));338 Option<List<Type>> throwsClause_result = recurOnOptionOfListOfType(NodeUtil.getThrowsClause(that)); 339 339 Expr body_result = (Expr) recur(that.getBody()); 340 340 FnHeader header = (FnHeader) forFnHeaderOnly(that.getHeader(), … … 449 449 IdOrOpOrAnonymousName name_result, 450 450 Option<WhereClause> whereClause_result, 451 Option<List< BaseType>> throwsClause_result,451 Option<List<Type>> throwsClause_result, 452 452 Option<Contract> contract_result, 453 453 List<Param> params_result, -
trunk/ProjectFortress/src/com/sun/fortress/tools/FortressAstToConcrete.java
r4275 r4280 465 465 Option<String> where_result = recurOnOptionOfWhereClause(NodeUtil.getWhereClause(that)); 466 466 Option<List<String>> params_result = recurOnOptionOfListOfParam(NodeUtil.getParams(that)); 467 Option<List<String>> throwsClause_result = recurOnOptionOfListOf BaseType(NodeUtil.getThrowsClause(that));467 Option<List<String>> throwsClause_result = recurOnOptionOfListOfType(NodeUtil.getThrowsClause(that)); 468 468 Option<String> contract_result = recurOnOptionOfContract(NodeUtil.getContract(that)); 469 469 List<String> decls_result = myRecurOnListOfDecl(NodeUtil.getDecls(that)); … … 593 593 Option<String> returnType_result = recurOnOptionOfType(header.getReturnType()); 594 594 Option<String> whereClause_result = recurOnOptionOfWhereClause(header.getWhereClause()); 595 Option<List<String>> throwsClause_result = recurOnOptionOfListOf BaseType(header.getThrowsClause());595 Option<List<String>> throwsClause_result = recurOnOptionOfListOfType(header.getThrowsClause()); 596 596 Option<String> contract_result = recurOnOptionOfContract(header.getContract()); 597 597 String unambiguousName_result = recur(that.getUnambiguousName()); … … 1536 1536 Option<String> returnType_result = recurOnOptionOfType(header.getReturnType()); 1537 1537 Option<String> whereClause_result = recurOnOptionOfWhereClause(header.getWhereClause()); 1538 Option<List<String>> throwsClause_result = recurOnOptionOfListOf BaseType(header.getThrowsClause());1538 Option<List<String>> throwsClause_result = recurOnOptionOfListOfType(header.getThrowsClause()); 1539 1539 String body_result = recur(that.getBody()); 1540 1540 return forFnExprOnly(that,

