Skip to content

Commit

Permalink
Account for sub-types in ComplexTypeTools.toComplex().
Browse files Browse the repository at this point in the history
  • Loading branch information
player-03 authored Jul 6, 2023
1 parent a8e181c commit 40e6c64
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion std/haxe/macro/MacroStringTools.hx
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,10 @@ class MacroStringTools {

static public function toComplex(path:String):ComplexType {
var pack = path.split(".");
return TPath({pack: pack, name: pack.pop(), params: []});
if(pack.length >= 2 && ~/^[A-Z]/.match(pack[pack.length - 2])) {
return TPath({pack: pack, sub: pack.pop(), name: pack.pop(), params: []});
} else {
return TPath({pack: pack, name: pack.pop(), params: []});
}
}
}

0 comments on commit 40e6c64

Please sign in to comment.