This commit is contained in:
NeeEoo
2024-04-26 03:40:38 +02:00
parent 4d274954e3
commit 15bd6b038a
2 changed files with 11 additions and 3 deletions
+5 -3
View File
@@ -574,7 +574,7 @@ class Interp {
var splitClassName:Array<String> = c.split(".");
if (splitClassName.length <= 0) return null;
var varName:String = switch(mode) {
case IAs(name): name;
default: splitClassName[splitClassName.length-1];
@@ -601,6 +601,9 @@ class Interp {
var newClassName:Array<String> = splitClassName.copy();
importField = newClassName.pop();
if(variables.exists(importField))
return variables.get(importField);
importedClass = getClass(newClassName.join("."));
}
@@ -611,8 +614,7 @@ class Interp {
case Right(e): Tools.getEnum(e);
};
if(importField != null) {
var v:Dynamic = null;
if(v == null) v = UnsafeReflect.getProperty(classOrEnum, importField);
var v:Dynamic = UnsafeReflect.getProperty(classOrEnum, importField);
if(v == null) v = UnsafeReflect.field(classOrEnum, importField);
if(v == null)
+6
View File
@@ -112,6 +112,12 @@ class FinalCase extends TestCase {
Std.isOfType('', String);
", Std.isOfType('', String));
assertEq("
import Std.isOfType;
isOfType('', String);
", Std.isOfType('', String));
assertEq("
import Math.round as F;
F(2.9);", Math.round(2.9));