Skip to content

Commit 2848a80

Browse files
committed
More @meth removal
1 parent a1a131b commit 2848a80

File tree

7 files changed

+45
-57
lines changed

7 files changed

+45
-57
lines changed

analysis/examples/larger-project/src/BucklescriptAnnotations.res

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,8 @@ type someMutableFields = {
1111

1212
@genType
1313
type someMethods = {
14-
@meth
1514
"send": string => unit,
16-
@meth
1715
"on": (string, (. int) => unit) => unit,
18-
@meth
1916
"threeargs": (int, string, int) => string,
2017
"twoArgs": (. int, string) => int,
2118
}

tests/analysis_tests/tests-reanalyze/deadcode/src/BucklescriptAnnotations.res

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,8 @@ type someMutableFields = {
1111

1212
@genType
1313
type someMethods = {
14-
@meth
1514
"send": string => unit,
16-
@meth
1715
"on": (string, (. int) => unit) => unit,
18-
@meth
1916
"threeargs": (int, string, int) => string,
2017
"twoArgs": (. int, string) => int,
2118
}

tests/gentype_tests/typescript-react-example/src/BucklescriptAnnotations.res

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,8 @@ type someMutableFields = {
1111

1212
@genType
1313
type someMethods = {
14-
@meth
1514
"send": string => unit,
16-
@meth
1715
"on": (string, int => unit) => unit,
18-
@meth
1916
"threeargs": (int, string, int) => string,
2017
"twoArgs": (int, string) => int,
2118
}

tests/syntax_tests/data/parsing/errors/typexpr/bsObjSugar.res

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ type state = {
2020
}
2121

2222
type state = {
23-
@meth
2423
"send": string =>
2524
}
2625

tests/syntax_tests/data/parsing/errors/typexpr/expected/bsObjSugar.res.txt

Lines changed: 43 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -51,85 +51,85 @@
5151

5252

5353
Syntax error!
54-
syntax_tests/data/parsing/errors/typexpr/bsObjSugar.res:25:1
54+
syntax_tests/data/parsing/errors/typexpr/bsObjSugar.res:24:1
5555

56-
23 @meth
57-
24 │ "send": string =>
58-
25 │ }
59-
26
60-
27 │ type state = {
56+
22type state = {
57+
23 │ "send": string =>
58+
24 │ }
59+
25
60+
26 │ type state = {
6161

6262
I'm missing a type here
6363

6464

6565
Syntax error!
66-
syntax_tests/data/parsing/errors/typexpr/bsObjSugar.res:28:10
66+
syntax_tests/data/parsing/errors/typexpr/bsObjSugar.res:27:10
6767

68-
26
69-
27 │ type state = {
70-
28 │ "age": ,
71-
29 │ "name": string
72-
30 │ }
68+
25
69+
26 │ type state = {
70+
27 │ "age": ,
71+
28 │ "name": string
72+
29 │ }
7373

7474
I'm missing a type here
7575

7676

7777
Syntax error!
78-
syntax_tests/data/parsing/errors/typexpr/bsObjSugar.res:33:15
78+
syntax_tests/data/parsing/errors/typexpr/bsObjSugar.res:32:15
7979

80-
31
81-
32 │ type state = {
82-
33 │ @set "age": ,
83-
34 │ "name": string
84-
35 │ }
80+
30
81+
31 │ type state = {
82+
32 │ @set "age": ,
83+
33 │ "name": string
84+
34 │ }
8585

8686
I'm missing a type here
8787

8888

8989
Syntax error!
90-
syntax_tests/data/parsing/errors/typexpr/bsObjSugar.res:37:25
90+
syntax_tests/data/parsing/errors/typexpr/bsObjSugar.res:36:25
9191

92-
35 │ }
93-
36
94-
37 │ type state = {.. "age": }
95-
38 │ type state = {
96-
39 │ ..
92+
34 │ }
93+
35
94+
36 │ type state = {.. "age": }
95+
37 │ type state = {
96+
38 │ ..
9797

9898
I'm missing a type here
9999

100100

101101
Syntax error!
102-
syntax_tests/data/parsing/errors/typexpr/bsObjSugar.res:40:8-41:8
102+
syntax_tests/data/parsing/errors/typexpr/bsObjSugar.res:39:8-40:8
103103

104-
38 │ type state = {
105-
39 │ ..
106-
40 │ "age"
107-
41 │ "name": string
108-
42 │ }
109-
43
104+
37 │ type state = {
105+
38 │ ..
106+
39 │ "age"
107+
40 │ "name": string
108+
41 │ }
109+
42
110110

111111
Did you forget a `:` here? It signals the start of a type
112112

113113

114114
Syntax error!
115-
syntax_tests/data/parsing/errors/typexpr/bsObjSugar.res:46:3-11
115+
syntax_tests/data/parsing/errors/typexpr/bsObjSugar.res:45:3-11
116116

117-
44 │ type websocket = {
118-
45 │ "id":
119-
46 │ "channel": channelTyp
120-
47 │ }
121-
48
117+
43 │ type websocket = {
118+
44 │ "id":
119+
45 │ "channel": channelTyp
120+
46 │ }
121+
47
122122

123123
I'm missing a type here
124124

125125

126126
Syntax error!
127-
syntax_tests/data/parsing/errors/typexpr/bsObjSugar.res:50:7-51:0
127+
syntax_tests/data/parsing/errors/typexpr/bsObjSugar.res:49:7-50:0
128128

129-
48
130-
49 │ type websocket = {
131-
50 │ "id"
132-
51
129+
47
130+
48 │ type websocket = {
131+
49 │ "id"
132+
50
133133

134134
Did you forget a `:` here? It signals the start of a type
135135

@@ -141,8 +141,7 @@ type nonrec state =
141141
< url: string ;protocols: [%rescript.typehole ] ;websocket: Websocket.t
142142
>
143143
type nonrec state = < url: string ;protocols: [%rescript.typehole ] >
144-
type nonrec state =
145-
< send: string -> [%rescript.typehole ] (a:1) [@meth ] >
144+
type nonrec state = < send: string -> [%rescript.typehole ] (a:1) >
146145
type nonrec state = < age: [%rescript.typehole ] ;name: string >
147146
type nonrec state = < age: [%rescript.typehole ] [@set ] ;name: string >
148147
type nonrec state = < age: [%rescript.typehole ] ;.. >

tests/tests/src/meth_annotation.res

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
// The @meth annotation is for backwards compatibility. It just makes the type uncurried.
2-
type person = {@meth "say": (string, string) => unit}
1+
type person = {"say": (string, string) => unit}
32

43
@val external john: person = "john"
54

tests/tests/src/reasonReact.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ and oldNewSelf<'state, 'retainedProps, 'action> = {
117117
type rec jsComponentThis<'state, 'props, 'retainedProps, 'action> = {
118118
"state": totalState<'state, 'retainedProps, 'action>,
119119
"props": {"reasonProps": 'props},
120-
"setState": @meth (
120+
"setState": (
121121
(
122122
totalState<'state, 'retainedProps, 'action>,
123123
'props,

0 commit comments

Comments
 (0)