Skip to content

Commit b642dfb

Browse files
committed
fixed inline abstract methods, fixed array access on some abstracts
1 parent 4b6b5e5 commit b642dfb

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

hscript/Checker.hx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ class CheckerTypes {
153153
var fl : CField = {
154154
isPublic : f.isPublic,
155155
canWrite : f.set.match(RNormal | RCall(_) | RDynamic),
156-
isMethod : f.set == RMethod || f.set == RDynamic,
156+
isMethod : f.set == RMethod || f.set == RDynamic || f.get == RInline,
157157
complete : complete,
158158
params : [],
159159
name : f.name,
@@ -1609,6 +1609,16 @@ class Checker {
16091609
var t = abstractOp(expr,a,args,arr,"[]",index);
16101610
if( t != null )
16111611
return t;
1612+
// the operator can have been DCE'ed but hscript Interp supports maps
1613+
if( a.name == "haxe.ds.Map" )
1614+
return args[1];
1615+
// if we implicit cast to an Array, allow it
1616+
for( t in a.to )
1617+
switch( follow(t) ) {
1618+
case TInst({ name : "Array" },[et]):
1619+
return apply(et,a.params,args);
1620+
default:
1621+
}
16121622
error("Invalid array accessor", arr);
16131623
default:
16141624
error(typeStr(at)+" is not an Array", arr);

0 commit comments

Comments
 (0)