File tree 1 file changed +16
-7
lines changed
1 file changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -190,14 +190,23 @@ class ReactMacro
190
190
var neededAttrs = [];
191
191
192
192
try {
193
- var tprops = Context .storeTypedExpr (Context .typeExpr (macro @:pos (type .pos ) {
194
- function get <T >(c : Class <T >): T return null ;
195
- @:privateAccess get ($type ).props ;
196
- }));
193
+ switch (Context .typeof (type )) {
194
+ case TType (_ , _ ):
195
+ var tprops = Context .storeTypedExpr (Context .typeExpr (macro @:pos (type .pos ) {
196
+ function get <T >(c : Class <T >): T return null ;
197
+ @:privateAccess get ($type ).props ;
198
+ }));
197
199
198
- switch (Context .typeof (tprops ))
199
- {
200
- case TType (_ .get () => _ .type => TAnonymous (_ .get ().fields => fields ), _ ):
200
+ switch (Context .typeof (tprops )) {
201
+ case TType (_ .get () => _ .type => TAnonymous (_ .get ().fields => fields ), _ ):
202
+ for (f in fields )
203
+ if (! f .meta .has (' :optional' ))
204
+ neededAttrs .push (f .name );
205
+
206
+ default :
207
+ }
208
+
209
+ case TFun ([{t : TType (_ .get () => _ .type => TAnonymous (_ .get ().fields => fields ), _ )}], _ ):
201
210
for (f in fields )
202
211
if (! f .meta .has (' :optional' ))
203
212
neededAttrs .push (f .name );
You can’t perform that action at this time.
0 commit comments