Changeset 48ec19a for tests/exceptions/polymorphic.cfa
- Timestamp:
- Jun 26, 2023, 10:51:47 AM (2 years ago)
- 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. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
tests/exceptions/polymorphic.cfa
radc73a5 r48ec19a 1 1 // Testing polymophic exception types. 2 3 #include <fstream.hfa> 2 4 3 5 forall(T &) exception proxy {}; … … 13 15 throw an_int; 14 16 } catch (proxy(int) *) { 15 printf("terminate catch\n");17 sout | "terminate catch"; 16 18 } 17 19 … … 19 21 throwResume a_char; 20 22 } catchResume (proxy(char) *) { 21 printf("resume catch\n");23 sout | "resume catch"; 22 24 } 23 25 … … 25 27 throw a_char; 26 28 } catch (proxy(int) *) { 27 printf("caught proxy(int)\n");29 sout | "caught proxy(int)"; 28 30 } catch (proxy(char) *) { 29 printf("caught proxy(char)\n");31 sout | "caught proxy(char)"; 30 32 } 31 33 } … … 44 46 throw except; 45 47 } catch (cell(int) * error) { 46 printf("%d\n", error->data);48 sout | error->data; 47 49 } 48 50 … … 50 52 cell(bool) ball = {&bool_cell, false}; 51 53 throwResume ball; 52 printf("%i\n", ball.data);54 sout | ball.data; 53 55 } catchResume (cell(bool) * error) { 54 printf("%i\n", error->data);56 sout | error->data; 55 57 error->data = true; 56 58 } … … 59 61 int main(int argc, char * argv[]) { 60 62 proxy_test(); 61 printf("\n");63 sout | nl; 62 64 cell_test(); 63 65 }
Note:
See TracChangeset
for help on using the changeset viewer.