iter 23.1.4: E2E fixture — bare LT match via implicit prelude import
This commit is contained in:
@@ -0,0 +1,48 @@
|
||||
{
|
||||
"schema": "ailang/v0",
|
||||
"name": "ordering_match",
|
||||
"imports": [],
|
||||
"defs": [
|
||||
{
|
||||
"kind": "fn",
|
||||
"name": "main",
|
||||
"type": {
|
||||
"k": "fn",
|
||||
"params": [],
|
||||
"ret": { "k": "con", "name": "Unit" },
|
||||
"effects": ["IO"]
|
||||
},
|
||||
"params": [],
|
||||
"doc": "Iter 23.1 fixture: pattern-match on prelude Ordering ctor without explicit prelude import.",
|
||||
"body": {
|
||||
"t": "do",
|
||||
"op": "io/print_int",
|
||||
"args": [
|
||||
{
|
||||
"t": "match",
|
||||
"scrutinee": {
|
||||
"t": "ctor",
|
||||
"type": "Ordering",
|
||||
"ctor": "LT",
|
||||
"args": []
|
||||
},
|
||||
"arms": [
|
||||
{
|
||||
"pat": { "p": "ctor", "ctor": "LT", "fields": [] },
|
||||
"body": { "t": "lit", "lit": { "kind": "int", "value": 1 } }
|
||||
},
|
||||
{
|
||||
"pat": { "p": "ctor", "ctor": "EQ", "fields": [] },
|
||||
"body": { "t": "lit", "lit": { "kind": "int", "value": 2 } }
|
||||
},
|
||||
{
|
||||
"pat": { "p": "ctor", "ctor": "GT", "fields": [] },
|
||||
"body": { "t": "lit", "lit": { "kind": "int", "value": 3 } }
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
Reference in New Issue
Block a user