Changeset 4520b77e for tests


Ignore:
Timestamp:
Sep 20, 2022, 8:37:05 PM (2 years ago)
Author:
JiadaL <j82liang@…>
Branches:
ADT, ast-experimental, master, pthread-emulation
Children:
a065f1f
Parents:
d489da8 (diff), 12df6fe (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 to Master Sept 19

Location:
tests/enum_tests
Files:
8 added
1 edited

Legend:

Unmodified
Added
Removed
  • tests/enum_tests/structEnum.cfa

    rd489da8 r4520b77e  
    22
    33struct Point {
    4     int x;
    5     char y;
     4     int x;
     5     char y;
    66};
    77
    88enum(Point) PointEnum {
    9     first={
    10         100,
    11         'c'
    12     },
    13     second={
    14         200,
    15         'a'
    16     }
     9     first={
     10         100,
     11         'c'
     12     },
     13     second={
     14         200,
     15         'a'
     16     }
    1717};
     18
     19PointEnum foo(PointEnum in) {
     20     return in;
     21}
    1822
    1923// The only valid usage
    2024struct Point apple = first;
    2125// Failed due to Qualified name is currently unimplemented.
    22 // struct Point banana = PointEnum.first;
    2326
    2427int main() {
    25     printf("%d %c\n", apple.x, apple.y);
    26     // Failed; enumInstType is now not a real type and not instantiated.
    27     // Not sure if we want that
    28     // printf("%d %c\n", second.x, second.y);
    29     return 0;
     28     PointEnum vals = second;
     29     PointEnum val2;
     30     // The failing line: assignment
     31     // val2 = vals;
     32
     33     printf("%d %c\n", apple.x, apple.y);
     34     // Failed; enumInstType is now not a real type and not instantiated.
     35     // Not sure if we want that
     36     // printf("%d %c\n", second.x, second.y);
     37     return 0;
    3038}
Note: See TracChangeset for help on using the changeset viewer.