Skip to content

Commit caa5f0b

Browse files
committed
added @:arrayAccess abstract metadata support
1 parent 8867ed7 commit caa5f0b

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

hscript/Checker.hx

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -324,13 +324,18 @@ class CheckerTypes {
324324
}
325325
if( f.meta == null ) continue;
326326
for( m in f.meta ) {
327-
if( m.name == ":op" && m.params != null && m.params.length == 1 ) {
328-
var op = switch( Tools.expr(m.params[0]) ) {
327+
var op = null;
328+
if( m.name == ":op" && m.params != null && m.params.length == 1 && m.params[0] != null ) {
329+
op = switch( Tools.expr(m.params[0]) ) {
329330
case EField(_): ".";
330331
case EBinop(op,_,_): op;
331332
case EArrayDecl([]): "[]";
332-
default: continue;
333+
default: null;
333334
}
335+
}
336+
if( m.name == ":arrayAccess" )
337+
op = "[]";
338+
if( op != null ) {
334339
var ops = ta.ops.get(op);
335340
if( ops == null ) {
336341
ops = [];

0 commit comments

Comments
 (0)