source: tests/enum_tests/structEnum.cfa @ 0e34a14

ADTast-experimentalpthread-emulation
Last change on this file since 0e34a14 was 72e76fd, checked in by Andrew Beach <ajbeach@…>, 2 years ago

Converted the last pass in validate B (linkReferenceToTypes). Cleaned up a related test.

  • Property mode set to 100644
File size: 554 bytes
Line 
1#include <stdio.h>
2
3struct Point {
4    int x;
5    char y;
6};
7
8enum(Point) PointEnum {
9    first={
10        100,
11        'c'
12    },
13    second={
14        200,
15        'a'
16    }
17};
18
19// The only valid usage
20struct Point apple = first;
21// Failed due to Qualified name is currently unimplemented.
22// struct Point banana = PointEnum.first;
23
24int 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;
30}
Note: See TracBrowser for help on using the repository browser.