aboutsummaryrefslogtreecommitdiff
path: root/tests/issues/test_issue_2395.odin
blob: bbbcb3aeaf10b32ad2942ac6da3364994849938e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Tests issue #2395 https://github.com/odin-lang/Odin/issues/2395

// Ensures that we no longer raise the faulty error for #no_nil unions when
// then are 2 variants with the polymorphic type. Also ensure that we raise
// exactly 2 errors from the invalid unions
package test_issues

ValidUnion :: union($T: typeid) #no_nil {
    T,
    f32,
}

OtherValidUnion :: union($T: typeid, $S: typeid) #no_nil {
    T,
    S,
}

InvalidUnion :: union($T: typeid) #no_nil {
    T,
}

OtherInvalidUnion :: union($T: typeid) #no_nil {
    u8,
}

main :: proc() {
}