Show
Ignore:
Timestamp:
10/22/09 23:51:27 (5 weeks ago)
Author:
jrhil47
Message:

[AST] Made the throws clause allow types that are not base types.

Location:
trunk/ProjectFortress/src/com/sun/fortress
Files:
27 modified

Legend:

Unmodified
Added
Removed
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/OverloadSet.java

    r4254 r4280  
    7777        } 
    7878 
    79         public List<BaseType> thrownTypes() { 
     79        public List<Type> thrownTypes() { 
    8080            return tagF.thrownTypes(); 
    8181        } 
     
    789789        HashSet<Type> exceptions = new HashSet<Type>(); 
    790790        for (TaggedFunctionName f : lessSpecificThanSoFar) { 
    791             List<BaseType> f_exceptions = f.thrownTypes(); 
     791            List<Type> f_exceptions = f.thrownTypes(); 
    792792            exceptions.addAll(f_exceptions); 
    793793        } 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/desugarer/DesugaringVisitor.java

    r4096 r4280  
    591591        List<StaticParam> staticParams_result = recurOnListOfStaticParam(header.getStaticParams()); 
    592592        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()); 
    594594        Option<Contract> contract_result = recurOnOptionOfContract(header.getContract()); 
    595595        List<Param> params_result = recurOnListOfParam(header.getParams()); 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/disambiguator/TypeDisambiguator.java

    r4275 r4280  
    9494                                                         (Id) NodeUtil.getName(that).accept(v), 
    9595                                                         v.recurOnOptionOfWhereClause(NodeUtil.getWhereClause(that)), 
    96                                                          Option.<List<BaseType>>none(), 
     96                                                         Option.<List<Type>>none(), 
    9797                                                         Option.<Contract>none(), 
    9898                                                         v.recurOnListOfTraitTypeWhere(NodeUtil.getExtendsClause(that)), 
     
    118118                                                         (Id) NodeUtil.getName(that).accept(v), 
    119119                                                         v.recurOnOptionOfWhereClause(NodeUtil.getWhereClause(that)), 
    120                                                          Option.<List<BaseType>>none(), 
     120                                                         Option.<List<Type>>none(), 
    121121                                                         Option.<Contract>none(), 
    122122                                                         v.recurOnListOfTraitTypeWhere(NodeUtil.getExtendsClause(that)), 
     
    142142                                                     (IdOrOpOrAnonymousName) NodeUtil.getName(that).accept(v), 
    143143                                                     v.recurOnOptionOfWhereClause(NodeUtil.getWhereClause(that)), 
    144                                                      v.recurOnOptionOfListOfBaseType(NodeUtil.getThrowsClause(that)), 
     144                                                     v.recurOnOptionOfListOfType(NodeUtil.getThrowsClause(that)), 
    145145                                                     v.recurOnOptionOfContract(NodeUtil.getContract(that)), 
    146146                                                     v.recurOnListOfParam(NodeUtil.getParams(that)), 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/index/Coercion.java

    r4211 r4280  
    154154 
    155155    @Override 
    156     public List<BaseType> thrownTypes() { 
     156    public List<Type> thrownTypes() { 
    157157        if (NodeUtil.getThrowsClause(_ast).isNone()) return Collections.emptyList(); 
    158158        else return Collections.unmodifiableList(NodeUtil.getThrowsClause(_ast).unwrap()); 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/index/Constructor.java

    r4172 r4280  
    3535    private final List<StaticParam> _staticParams; 
    3636    private final Option<List<Param>> _params; 
    37     private final Option<List<BaseType>> _throwsClause; 
     37    private final Option<List<Type>> _throwsClause; 
    3838    private final Option<WhereClause> _where; 
    3939 
    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) { 
    4141        _declaringTrait = declaringTrait; 
    4242        _staticParams = staticParams; 
     
    5959        _staticParams = visitor.recurOnListOfStaticParam(that._staticParams); 
    6060        _params = visitor.recurOnOptionOfListOfParam(that._params); 
    61         _throwsClause = visitor.recurOnOptionOfListOfBaseType(that._throwsClause); 
     61        _throwsClause = visitor.recurOnOptionOfListOfType(that._throwsClause); 
    6262        _where = visitor.recurOnOptionOfWhereClause(that._where); 
    6363 
     
    117117 
    118118    @Override 
    119     public List<BaseType> thrownTypes() { 
     119    public List<Type> thrownTypes() { 
    120120        if (_throwsClause.isNone()) return Collections.emptyList(); 
    121121        else return Collections.unmodifiableList(_throwsClause.unwrap()); 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/index/DeclaredFunction.java

    r4172 r4280  
    9898 
    9999    @Override 
    100     public List<BaseType> thrownTypes() { 
     100    public List<Type> thrownTypes() { 
    101101        if (NodeUtil.getThrowsClause(_ast).isNone()) return Collections.emptyList(); 
    102102        else return Collections.unmodifiableList(NodeUtil.getThrowsClause(_ast).unwrap()); 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/index/DeclaredMethod.java

    r4172 r4280  
    9494 
    9595    @Override 
    96     public List<BaseType> thrownTypes() { 
     96    public List<Type> thrownTypes() { 
    9797        if (NodeUtil.getThrowsClause(_ast).isNone()) return Collections.emptyList(); 
    9898        else return Collections.unmodifiableList(NodeUtil.getThrowsClause(_ast).unwrap()); 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/index/FieldGetterOrSetterMethod.java

    r4172 r4280  
    9898 
    9999    @Override 
    100     public List<BaseType> thrownTypes() { 
     100    public List<Type> thrownTypes() { 
    101101        return Collections.emptyList(); 
    102102    } 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/index/Functional.java

    r4172 r4280  
    3636    public abstract List<Param> parameters(); 
    3737 
    38     public abstract List<BaseType> thrownTypes(); 
     38    public abstract List<Type> thrownTypes(); 
    3939 
    4040    public abstract Modifiers mods(); 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/index/FunctionalMethod.java

    r4217 r4280  
    145145 
    146146    @Override 
    147     public List<BaseType> thrownTypes() { 
     147    public List<Type> thrownTypes() { 
    148148        if (NodeUtil.getThrowsClause(_ast).isNone()) return Collections.emptyList(); 
    149149        else return Collections.unmodifiableList(NodeUtil.getThrowsClause(_ast).unwrap()); 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/typechecker/InferenceVarInserter.java

    r3783 r4280  
    6868        List<StaticParam> staticParams_result = recurOnListOfStaticParam(header.getStaticParams()); 
    6969        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()); 
    7171        Option<Contract> contract_result = recurOnOptionOfContract(header.getContract()); 
    7272        List<Param> params_result = recurOnListOfParam(header.getParams()); 
     
    8686                              List<StaticParam> staticParams_result, List<Param> params_result, 
    8787                              Option<Type> returnType_result, 
    88                               Option<List<BaseType>> throwsClause_result, 
     88                              Option<List<Type>> throwsClause_result, 
    8989                              Option<WhereClause> where_result, 
    9090                              Option<Contract> contract_result, 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/typechecker/TypeAnalyzer.java

    r4254 r4280  
    399399            @Override public Effect forEffectOnly(Effect e, 
    400400                                                  ASTNodeInfo info_result, 
    401                                                   Option<List<BaseType>> normalThrows) { 
     401                                                  Option<List<Type>> normalThrows) { 
    402402                if (normalThrows.isNone()) { return e; } 
    403403                else { 
    404                     List<BaseType> reduced = reduceDisjuncts(normalThrows.unwrap(), 
     404                    List<Type> reduced = reduceDisjuncts(normalThrows.unwrap(), 
    405405                                                             _emptyHistory); 
    406406                    if (reduced.isEmpty()) { return NodeFactory.makeEffect(NodeFactory.makeSpan(e), e.isIoEffect()); } 
     
    11641164    private ConstraintFormula sub(Effect s, Effect t, SubtypeHistory h) { 
    11651165        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)); 
    11691169            return sub(sThrows, tThrows, h); 
    11701170        } 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/typechecker/TypeAnalyzerJUTest.java

    r3963 r4280  
    649649        if (s.startsWith("{")) { elts = splitList(s, "{", "}"); } 
    650650        else { elts = Collections.singletonList(s); } 
    651         List<BaseType> ts = new LinkedList<BaseType>(); 
     651        List<Type> ts = new LinkedList<Type>(); 
    652652        for (String elt : elts) { 
    653653            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); 
    658655        } 
    659656        return NodeFactory.makeEffect(span, Option.some(ts), io); 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/typechecker/TypeAnalyzerUtil.java

    r3538 r4280  
    174174                        recurOnKeywords(_d.getKeywords()) || 
    175175                        t.getRange().accept(this) || 
    176                         recurOnList(t.getEffect().getThrowsClause().unwrap(Collections.<BaseType>emptyList())); 
     176                        recurOnList(t.getEffect().getThrowsClause().unwrap(Collections.<Type>emptyList())); 
    177177                } else 
    178178                    return d.accept(this) || 
    179179                        t.getRange().accept(this) || 
    180                         recurOnList(t.getEffect().getThrowsClause().unwrap(Collections.<BaseType>emptyList())); 
     180                        recurOnList(t.getEffect().getThrowsClause().unwrap(Collections.<Type>emptyList())); 
    181181            } 
    182182            @Override public Boolean forTupleType(TupleType t) { 
  • trunk/ProjectFortress/src/com/sun/fortress/compiler/typechecker/TypeChecker.java

    r4275 r4280  
    23922392        List<TypeCheckerResult> all_results = new ArrayList<TypeCheckerResult>(); 
    23932393 
    2394         Option<List<TypeCheckerResult>> throwsClause_result = recurOnOptionOfListOfBaseType(NodeUtil.getThrowsClause(that)); 
     2394        Option<List<TypeCheckerResult>> throwsClause_result = recurOnOptionOfListOfType(NodeUtil.getThrowsClause(that)); 
    23952395 
    23962396 
     
    24582458        // All throws types must be a subtype of exception 
    24592459        if( NodeUtil.getThrowsClause(that).isSome() ) { 
    2460             for( BaseType exn : NodeUtil.getThrowsClause(that).unwrap() ) { 
     2460            for( Type exn : NodeUtil.getThrowsClause(that).unwrap() ) { 
    24612461                all_results.add(this.checkSubtype(exn, Types.CHECKED_EXCEPTION, that, 
    24622462                        "Types in throws clause must be subtypes of CheckedException, but "+ 
     
    24752475                (Option<Type>)TypeCheckerResult.astFromResult(returnType_result), 
    24762476                NodeUtil.getWhereClause(that), 
    2477                 (Option<List<BaseType>>)TypeCheckerResult.astFromResults(throwsClause_result), 
     2477                (Option<List<Type>>)TypeCheckerResult.astFromResults(throwsClause_result), 
    24782478                (Expr)body_result.ast() ); 
    24792479 
     
    35483548        } 
    35493549        Option<List<TypeCheckerResult>> paramsResult = checker_with_sparams.recurOnOptionOfListOfParam(NodeUtil.getParams(that)); 
    3550         Option<List<TypeCheckerResult>> throwsClauseResult = checker_with_sparams.recurOnOptionOfListOfBaseType(NodeUtil.getThrowsClause(that)); 
     3550        Option<List<TypeCheckerResult>> throwsClauseResult = checker_with_sparams.recurOnOptionOfListOfType(NodeUtil.getThrowsClause(that)); 
    35513551 
    35523552        TypeChecker method_checker = checker_with_sparams; 
     
    36233623                (List<Decl>)TypeCheckerResult.astFromResults(decls_result), 
    36243624                (Option<List<Param>>)TypeCheckerResult.astFromResults(paramsResult), 
    3625                 (Option<List<BaseType>>)TypeCheckerResult.astFromResults(throwsClauseResult), 
     3625                (Option<List<Type>>)TypeCheckerResult.astFromResults(throwsClauseResult), 
    36263626                contract, 
    36273627                that.getSelfType()); 
  • trunk/ProjectFortress/src/com/sun/fortress/nodes_util/ExprFactory.java

    r4196 r4280  
    768768                                    Expr body) { 
    769769        return makeFnExpr(span, params, Option.<Type>none(), 
    770                           Option.<List<BaseType>>none(), body); 
     770                          Option.<List<Type>>none(), body); 
    771771    } 
    772772 
     
    774774                                    Option<Type> returnType, Expr body) { 
    775775        return makeFnExpr(span, params, returnType, 
    776                           Option.<List<BaseType>>none(), body); 
     776                          Option.<List<Type>>none(), body); 
    777777    } 
    778778 
    779779    public static FnExpr makeFnExpr(Span span, List<Param> params, 
    780780                                    Option<Type> returnType, 
    781                                     Option<List<BaseType>> throwsClause, 
     781                                    Option<List<Type>> throwsClause, 
    782782                                    Expr body) { 
    783783        return makeFnExpr(span, false, Option.<Type>none(), 
     
    796796                                    Option<Type> returnType, 
    797797                                    Option<WhereClause> whereClause, 
    798                                     Option<List<BaseType>> throwsClause, 
     798                                    Option<List<Type>> throwsClause, 
    799799                                    Expr body) { 
    800800        FnHeader header = NodeFactory.makeFnHeader(Modifiers.None, name, staticParams, 
     
    10181018                                                                 staticParams, 
    10191019                                                                 Option.<WhereClause>none(), 
    1020                                                                  Option.<List<BaseType>>none(), 
     1020                                                                 Option.<List<Type>>none(), 
    10211021                                                                 Option.<Contract>none(), 
    10221022                                                                 extendsC, decls); 
  • trunk/ProjectFortress/src/com/sun/fortress/nodes_util/NodeFactory.java

    r4275 r4280  
    331331                                          Option<Type> selfType) { 
    332332        TraitTypeHeader header = makeTraitTypeHeader(mods, name, sparams, whereC, 
    333                                                      Option.<List<BaseType>>none(), 
     333                                                     Option.<List<Type>>none(), 
    334334                                                     Option.<Contract>none(), 
    335335                                                     extendsC, decls); 
     
    354354                              extendsC, Option.<WhereClause>none(), decls, 
    355355                              Option.<List<Param>>none(), 
    356                               Option.<List<BaseType>>none(), 
     356                              Option.<List<Type>>none(), 
    357357                              Option.<Contract>none(), 
    358358                              selfType); 
     
    367367                              Option.<WhereClause>none(), 
    368368                              Collections.<Decl>emptyList(), params, 
    369                               Option.<List<BaseType>>none(), 
     369                              Option.<List<Type>>none(), 
    370370                              Option.<Contract>none(), 
    371371                              selfType); 
     
    382382                              Option.<WhereClause>none(), decls, 
    383383                              params, 
    384                               Option.<List<BaseType>>none(), 
     384                              Option.<List<Type>>none(), 
    385385                              Option.<Contract>none(),selfType); 
    386386    } 
     
    396396                Collections.<Decl>emptyList(), 
    397397                Option.<List<Param>>none(), 
    398                 Option.<List<BaseType>>none(), 
     398                Option.<List<Type>>none(), 
    399399                Option.<Contract>none(), 
    400400                Option.<Type>some(selfType)); 
     
    407407                                            List<Decl> decls, 
    408408                                            Option<List<Param>> params, 
    409                                             Option<List<BaseType>> throwsC, 
     409                                            Option<List<Type>> throwsC, 
    410410                                            Option<Contract> contract, 
    411411                                            Option<Type> selfType) { 
     
    418418    public static FnDecl mkFnDecl(Span span, Modifiers mods, 
    419419                                  FnHeaderFront fhf, FnHeaderClause fhc) { 
    420         Option<List<BaseType>> throws_ = fhc.getThrowsClause(); 
     420        Option<List<Type>> throws_ = fhc.getThrowsClause(); 
    421421        Option<WhereClause> where_ = fhc.getWhereClause(); 
    422422        Option<Contract> contract = fhc.getContractClause(); 
     
    432432                                  List<Param> params, 
    433433                                  FnHeaderClause fhc) { 
    434         Option<List<BaseType>> throws_ = fhc.getThrowsClause(); 
     434        Option<List<Type>> throws_ = fhc.getThrowsClause(); 
    435435        Option<WhereClause> where_ = fhc.getWhereClause(); 
    436436        Option<Contract> contract = fhc.getContractClause(); 
     
    450450                                  FnHeaderFront fhf, 
    451451                                  FnHeaderClause fhc, Expr expr) { 
    452         Option<List<BaseType>> throws_ = fhc.getThrowsClause(); 
     452        Option<List<Type>> throws_ = fhc.getThrowsClause(); 
    453453        Option<WhereClause> where_ = fhc.getWhereClause(); 
    454454        Option<Contract> contract = fhc.getContractClause(); 
     
    462462                                  List<StaticParam> sparams, List<Param> params, 
    463463                                  FnHeaderClause fhc, Option<Expr> expr) { 
    464         Option<List<BaseType>> throws_ = fhc.getThrowsClause(); 
     464        Option<List<Type>> throws_ = fhc.getThrowsClause(); 
    465465        Option<WhereClause> where_ = fhc.getWhereClause(); 
    466466        Option<Contract> contract = fhc.getContractClause(); 
     
    476476                                    Option<Type> returnType) { 
    477477        return makeFnDecl(span, mods, name, staticParams, params, returnType, 
    478                           Option.<List<BaseType>>none(), 
     478                          Option.<List<Type>>none(), 
    479479                          Option.<WhereClause>none(), 
    480480                          Option.<Contract>none()); 
     
    489489                          Collections.<StaticParam>emptyList(), 
    490490                          params, returnType, 
    491                           Option.<List<BaseType>>none(), 
     491                          Option.<List<Type>>none(), 
    492492                          Option.<WhereClause>none(), 
    493493                          Option.<Contract>none(), 
     
    500500                                    List<Param> params, 
    501501                                    Option<Type> returnType, 
    502                                     Option<List<BaseType>> throwsC, 
     502                                    Option<List<Type>> throwsC, 
    503503                                    Option<WhereClause> whereC, 
    504504                                    Option<Contract> contract) { 
     
    519519                                    List<Param> params, 
    520520                                    Option<Type> returnType, 
    521                                     Option<List<BaseType>> throwsC, 
     521                                    Option<List<Type>> throwsC, 
    522522                                    Option<WhereClause> whereC, 
    523523                                    Option<Contract> contract, 
     
    538538                                        List<StaticParam> staticParams, 
    539539                                        Option<WhereClause> whereClause, 
    540                                         Option<List<BaseType>> throwsClause, 
     540                                        Option<List<Type>> throwsClause, 
    541541                                        Option<Contract> contract, 
    542542                                        List<Param> params, 
     
    551551                                    List<Param> params, 
    552552                                    Option<Type> returnType, 
    553                                     Option<List<BaseType>> throwsC, 
     553                                    Option<List<Type>> throwsC, 
    554554                                    Option<WhereClause> whereC, 
    555555                                    Option<Contract> contract, 
     
    11741174 
    11751175    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) { 
    11801180        Span span; 
    11811181        if ( throwsClause.isEmpty() ) { 
     
    11881188    } 
    11891189 
    1190     public static Effect makeEffect(SourceLoc defaultLoc, List<BaseType> throwsClause) { 
     1190    public static Effect makeEffect(SourceLoc defaultLoc, List<Type> throwsClause) { 
    11911191        return makeEffect(NodeUtil.spanAll(defaultLoc, throwsClause), 
    11921192                          Option.some(throwsClause), false); 
    11931193    } 
    11941194 
    1195     public static Effect makeEffect(Option<List<BaseType>> throwsClause) { 
     1195    public static Effect makeEffect(Option<List<Type>> throwsClause) { 
    11961196        Span span; 
    11971197        if ( throwsClause.isNone() ) 
     
    12061206    } 
    12071207 
    1208     public static Effect makeEffect(SourceLoc defaultLoc, Option<List<BaseType>> throwsClause) { 
     1208    public static Effect makeEffect(SourceLoc defaultLoc, Option<List<Type>> throwsClause) { 
    12091209        Span span = NodeUtil.spanAll(defaultLoc, 
    1210                                          throwsClause.unwrap(Collections.<BaseType>emptyList())); 
     1210                                         throwsClause.unwrap(Collections.<Type>emptyList())); 
    12111211        return makeEffect(span, throwsClause, false); 
    12121212    } 
    12131213 
    12141214    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, 
    12201220                                    boolean ioEffect) { 
    12211221        return new Effect(makeSpanInfo(span), throwsC, ioEffect); 
     
    15451545                                   Collections.<StaticParam>emptyList(), 
    15461546                                   Option.<WhereClause>none(), 
    1547                                    Option.<List<BaseType>>none(), Option.<Contract>none(), 
     1547                                   Option.<List<Type>>none(), Option.<Contract>none(), 
    15481548                                   extendsClause, decls); 
    15491549    } 
     
    15531553                                                      List<StaticParam> staticParams, 
    15541554                                                      Option<WhereClause> whereClause, 
    1555                                                       Option<List<BaseType>> throwsClause, 
     1555                                                      Option<List<Type>> throwsClause, 
    15561556                                                      Option<Contract> contract, 
    15571557                                                      List<TraitTypeWhere> extendsClause, 
     
    24062406    public static FnHeaderClause makeFnClauses(BufferedWriter writer, Span span, 
    24072407                                               List<FnHeaderClause> clauses) { 
    2408         Option<List<BaseType>> throwsC = Option.<List<BaseType>>none(); 
     2408        Option<List<Type>> throwsC = Option.<List<Type>>none(); 
    24092409        Option<WhereClause> whereC = Option.<WhereClause>none(); 
    24102410        Option<List<Expr>> requiresC = Option.<List<Expr>>none(); 
     
    24732473    } 
    24742474 
    2475     public static FnHeaderClause makeThrowsClause(Option<List<BaseType>> throwsC) { 
     2475    public static FnHeaderClause makeThrowsClause(Option<List<Type>> throwsC) { 
    24762476        return makeFnHeaderClause(throwsC, Option.<WhereClause>none(), 
    24772477                                  Option.<Contract>none(), Option.<Type>none()); 
     
    24792479 
    24802480    public static FnHeaderClause makeWhereClause(Option<WhereClause> whereC) { 
    2481         return makeFnHeaderClause(Option.<List<BaseType>>none(), whereC, 
     2481        return makeFnHeaderClause(Option.<List<Type>>none(), whereC, 
    24822482                                  Option.<Contract>none(), Option.<Type>none()); 
    24832483    } 
    24842484 
    24852485    public static FnHeaderClause makeRequiresClause(Option<List<Expr>> requiresC) { 
    2486         return makeFnHeaderClause(Option.<List<BaseType>>none(), 
     2486        return makeFnHeaderClause(Option.<List<Type>>none(), 
    24872487                                  Option.<WhereClause>none(), 
    24882488                                  Option.<Contract>some(makeContract(parserSpan, requiresC, 
     
    24932493 
    24942494    public static FnHeaderClause makeEnsuresClause(Option<List<EnsuresClause>> ensuresC) { 
    2495         return makeFnHeaderClause(Option.<List<BaseType>>none(), 
     2495        return makeFnHeaderClause(Option.<List<Type>>none(), 
    24962496                                  Option.<WhereClause>none(), 
    24972497                                  Option.<Contract>some(makeContract(parserSpan, Option.<List<Expr>>none(), 
     
    25012501 
    25022502    public static FnHeaderClause makeInvariantsClause(Option<List<Expr>> invariantsC) { 
    2503         return makeFnHeaderClause(Option.<List<BaseType>>none(), 
     2503        return makeFnHeaderClause(Option.<List<Type>>none(), 
    25042504                                  Option.<WhereClause>none(), 
    25052505                                  Option.<Contract>some(makeContract(parserSpan, 
     
    25102510    } 
    25112511 
    2512     public static FnHeaderClause makeFnHeaderClause(Option<List<BaseType>> throwsC, 
     2512    public static FnHeaderClause makeFnHeaderClause(Option<List<Type>> throwsC, 
    25132513                                                    Option<WhereClause> whereC, 
    25142514                                                    Option<Contract> contractC, 
  • trunk/ProjectFortress/src/com/sun/fortress/nodes_util/NodeUtil.java

    r4275 r4280  
    255255    } 
    256256 
    257     public static Option<List<BaseType>> getThrowsClause(ObjectDecl o) { 
     257    public static Option<List<Type>> getThrowsClause(ObjectDecl o) { 
    258258        return o.getHeader().getThrowsClause(); 
    259259    } 
     
    337337    } 
    338338 
    339     public static Option<List<BaseType>> getThrowsClause(FnDecl f) { 
     339    public static Option<List<Type>> getThrowsClause(FnDecl f) { 
    340340        return f.getHeader().getThrowsClause(); 
    341341    } 
     
    366366    } 
    367367 
    368     public static Option<List<BaseType>> getThrowsClause(FnExpr f) { 
     368    public static Option<List<Type>> getThrowsClause(FnExpr f) { 
    369369        return f.getHeader().getThrowsClause(); 
    370370    } 
  • trunk/ProjectFortress/src/com/sun/fortress/parser/Expression.rats

    r4057 r4280  
    5858                                        Useful.list(NodeFactory.makeParam(a1)), 
    5959                                        Option.<Type>none(), 
    60                                         Option.<List<BaseType>>wrap(a2), a3); 
     60                                        Option.<List<Type>>wrap(a2), a3); 
    6161     } 
    6262   / <Fn2> fn w openparen a1:(w Params)? w closeparen a2:(w IsType)? a3:(w Throws)? w match w a4:Expr 
     
    6464       yyValue = ExprFactory.makeFnExpr(createSpan(yyStart,yyCount), a1, 
    6565                                        Option.<Type>wrap(a2), 
    66                                         Option.<List<BaseType>>wrap(a3), a4); 
     66                                        Option.<List<Type>>wrap(a3), a4); 
    6767     } 
    6868   / <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  
    202202FnHeaderClause FnClause = 
    203203     w a1:Throws 
    204      { yyValue = NodeFactory.makeThrowsClause(Option.<List<BaseType>>some(a1)); } 
     204     { yyValue = NodeFactory.makeThrowsClause(Option.<List<Type>>some(a1)); } 
    205205   / w a1:Where 
    206206     { yyValue = NodeFactory.makeWhereClause(Option.<WhereClause>some(a1)); } 
     
    219219/* Throws ::= throws w MayTraitTypes */ 
    220220/* MayTraitTypes ::= { w } | TraitTypes  */ 
    221 List<BaseType> Throws = 
     221List<Type> Throws = 
    222222     throws w opencurly w closecurly 
    223      { yyValue = Collections.<BaseType>emptyList(); } 
     223     { yyValue = Collections.<Type>emptyList(); } 
    224224   / throws w TraitTypes ; 
    225225 
  • trunk/ProjectFortress/src/com/sun/fortress/parser/NoNewlineType.rats

    r3875 r4280  
    8989PureList<PostfixOpExpr> TightInfixPostfix := ... 
    9090   / <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)))); } 
    9292   / <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)))); } 
    9494   / <Postfix> a1:DimPostfixOp sr a2:TypePrimary 
    9595     { yyValue = a2.cons((PostfixOpExpr)new Postfix(a1)); } 
     
    105105PureList<PostfixOpExpr> LooseInfix := ... 
    106106   / <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)))); } 
    108108   / <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)))); } 
    110110   / <Infix> a1:DimInfixOp sr a2:TypePrimary 
    111111     { yyValue = a2.cons((PostfixOpExpr)new LooseInfix(a1)); } 
  • trunk/ProjectFortress/src/com/sun/fortress/parser/Type.rats

    r3875 r4280  
    104104PureList<PostfixOpExpr> TightInfixPostfix = 
    105105     <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)))); } 
    107107   / <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)))); } 
    109109   / a1:DimInfixOp a2:TypePrimary 
    110110     { yyValue = a2.cons((PostfixOpExpr)new TightInfix(a1)); } 
     
    126126PureList<PostfixOpExpr> LooseInfix = 
    127127     <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)))); } 
    129129   / <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)))); } 
    131131   / <Infix> a1:DimInfixOp wr a2:TypePrimary 
    132132     { yyValue = a2.cons((PostfixOpExpr)new LooseInfix(a1)); } 
  • trunk/ProjectFortress/src/com/sun/fortress/parser_util/FnHeaderClause.java

    r4002 r4280  
    3333public class FnHeaderClause { 
    3434 
    35     private Option<List<BaseType>> throwsClause; 
     35    private Option<List<Type>> throwsClause; 
    3636    private Option<WhereClause> whereClause; 
    3737    private Option<Contract> contractClause; 
    3838    private Option<Type> returnType; 
    3939 
    40     public FnHeaderClause(Option<List<BaseType>> throwsClause, 
     40    public FnHeaderClause(Option<List<Type>> throwsClause, 
    4141                          Option<WhereClause> whereClause, 
    4242                          Option<Contract> contractClause, 
     
    4848    } 
    4949 
    50     public Option<List<BaseType>> getThrowsClause() { 
     50    public Option<List<Type>> getThrowsClause() { 
    5151        return throwsClause; 
    5252    } 
  • trunk/ProjectFortress/src/com/sun/fortress/scala_src/typechecker/CoercionOracle.scala

    r4251 r4280  
    270270    val (SArrowType(_, a, b, teff, _, _), SArrowType(_, d, e, ueff, _, _)) = (t, u) 
    271271    // 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]()) 
    274274 
    275275    // 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  
    758758  def apply(id:Id, staticParams: JavaList[StaticParam], 
    759759            params: JavaOption[JavaList[Param]], 
    760             throwsClause: JavaOption[JavaList[BaseType]], 
     760            throwsClause: JavaOption[JavaList[Type]], 
    761761            where: JavaOption[WhereClause]) = 
    762762    new JavaConstructor(id, staticParams, params, throwsClause, where) 
  • trunk/ProjectFortress/src/com/sun/fortress/syntax_abstractions/phases/Transform.java

    r4185 r4280  
    336336            Option<Type> returnType_result = recurOnOptionOfType(NodeUtil.getReturnType(that)); 
    337337            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)); 
    339339            Expr body_result = (Expr) recur(that.getBody()); 
    340340            FnHeader header = (FnHeader) forFnHeaderOnly(that.getHeader(), 
     
    449449                                                            IdOrOpOrAnonymousName name_result, 
    450450                                                            Option<WhereClause> whereClause_result, 
    451                                                             Option<List<BaseType>> throwsClause_result, 
     451                                                            Option<List<Type>> throwsClause_result, 
    452452                                                            Option<Contract> contract_result, 
    453453                                                            List<Param> params_result, 
  • trunk/ProjectFortress/src/com/sun/fortress/tools/FortressAstToConcrete.java

    r4275 r4280  
    465465            Option<String> where_result = recurOnOptionOfWhereClause(NodeUtil.getWhereClause(that)); 
    466466            Option<List<String>> params_result = recurOnOptionOfListOfParam(NodeUtil.getParams(that)); 
    467             Option<List<String>> throwsClause_result = recurOnOptionOfListOfBaseType(NodeUtil.getThrowsClause(that)); 
     467            Option<List<String>> throwsClause_result = recurOnOptionOfListOfType(NodeUtil.getThrowsClause(that)); 
    468468            Option<String> contract_result = recurOnOptionOfContract(NodeUtil.getContract(that)); 
    469469            List<String> decls_result = myRecurOnListOfDecl(NodeUtil.getDecls(that)); 
     
    593593        Option<String> returnType_result = recurOnOptionOfType(header.getReturnType()); 
    594594        Option<String> whereClause_result = recurOnOptionOfWhereClause(header.getWhereClause()); 
    595         Option<List<String>> throwsClause_result = recurOnOptionOfListOfBaseType(header.getThrowsClause()); 
     595        Option<List<String>> throwsClause_result = recurOnOptionOfListOfType(header.getThrowsClause()); 
    596596        Option<String> contract_result = recurOnOptionOfContract(header.getContract()); 
    597597        String unambiguousName_result = recur(that.getUnambiguousName()); 
     
    15361536        Option<String> returnType_result = recurOnOptionOfType(header.getReturnType()); 
    15371537        Option<String> whereClause_result = recurOnOptionOfWhereClause(header.getWhereClause()); 
    1538         Option<List<String>> throwsClause_result = recurOnOptionOfListOfBaseType(header.getThrowsClause()); 
     1538        Option<List<String>> throwsClause_result = recurOnOptionOfListOfType(header.getThrowsClause()); 
    15391539        String body_result = recur(that.getBody()); 
    15401540        return forFnExprOnly(that,