Ignore:
Timestamp:
Jun 26, 2023, 10:51:47 AM (2 years ago)
Author:
caparson <caparson@…>
Branches:
master
Children:
917e1fd
Parents:
adc73a5 (diff), 1fbf481 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge branch 'master' of plg.uwaterloo.ca:software/cfa/cfa-cc

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/exceptions/polymorphic.cfa

    radc73a5 r48ec19a  
    11// Testing polymophic exception types.
     2
     3#include <fstream.hfa>
    24
    35forall(T &) exception proxy {};
     
    1315                throw an_int;
    1416        } catch (proxy(int) *) {
    15                 printf("terminate catch\n");
     17                sout | "terminate catch";
    1618        }
    1719
     
    1921                throwResume a_char;
    2022        } catchResume (proxy(char) *) {
    21                 printf("resume catch\n");
     23                sout | "resume catch";
    2224        }
    2325
     
    2527                throw a_char;
    2628        } catch (proxy(int) *) {
    27                 printf("caught proxy(int)\n");
     29                sout | "caught proxy(int)";
    2830        } catch (proxy(char) *) {
    29                 printf("caught proxy(char)\n");
     31                sout | "caught proxy(char)";
    3032        }
    3133}
     
    4446                throw except;
    4547        } catch (cell(int) * error) {
    46                 printf("%d\n", error->data);
     48                sout | error->data;
    4749        }
    4850
     
    5052                cell(bool) ball = {&bool_cell, false};
    5153                throwResume ball;
    52                 printf("%i\n", ball.data);
     54                sout | ball.data;
    5355        } catchResume (cell(bool) * error) {
    54                 printf("%i\n", error->data);
     56                sout | error->data;
    5557                error->data = true;
    5658        }
     
    5961int main(int argc, char * argv[]) {
    6062        proxy_test();
    61         printf("\n");
     63        sout | nl;
    6264        cell_test();
    6365}
Note: See TracChangeset for help on using the changeset viewer.