Skip to content

Commit 1a8a965

Browse files
committed
wit, testdata/codegen: fix error-context
1 parent 96816c8 commit 1a8a965

2 files changed

Lines changed: 11 additions & 14 deletions

File tree

testdata/codegen/error-context.wit.json

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,14 @@
3636
},
3737
{
3838
"name": "y",
39-
"type": 1
39+
"type": "error-context"
4040
},
4141
{
4242
"name": "z",
43-
"type": 2
43+
"type": 1
4444
}
4545
],
46-
"result": 4
46+
"result": 3
4747
}
4848
},
4949
"package": 0
@@ -52,36 +52,33 @@
5252
"types": [
5353
{
5454
"name": "foo",
55-
"kind": "error-context",
55+
"kind": {
56+
"type": "error-context"
57+
},
5658
"owner": {
5759
"interface": 0
5860
}
5961
},
60-
{
61-
"name": null,
62-
"kind": "error-context",
63-
"owner": null
64-
},
6562
{
6663
"name": null,
6764
"kind": {
68-
"future": 1
65+
"future": "error-context"
6966
},
7067
"owner": null
7168
},
7269
{
7370
"name": null,
7471
"kind": {
75-
"stream": 1
72+
"stream": "error-context"
7673
},
7774
"owner": null
7875
},
7976
{
8077
"name": null,
8178
"kind": {
8279
"result": {
83-
"ok": 3,
84-
"err": 1
80+
"ok": 2,
81+
"err": "error-context"
8582
}
8683
},
8784
"owner": null

wit/type.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ func ParseType(s string) (Type, error) {
7171
case "string":
7272
return String{}, nil
7373
case "error-context":
74-
return &ErrorContext{}, nil
74+
return ErrorContext{}, nil
7575
}
7676
return nil, fmt.Errorf("unknown primitive type %q", s)
7777
}

0 commit comments

Comments
 (0)