Last active
April 7, 2020 02:40
-
-
Save kyubuns/1b4a99967052c7d1d94cacd0fe140305 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@:generic | |
class ArrayWrapper<T> | |
{ | |
public function new() {} | |
public var value: Array<T> = []; | |
#if cs | |
public function toTyped(): List_1<T> | |
{ | |
var v = new List_1<T>(); | |
for (e in value) | |
{ | |
v.Add(e); | |
} | |
return v; | |
} | |
#end | |
} |
private var _value: Arrayとして、
valueのgetterでList_1に変換しようとしたが、
hoge.value.push(123);
が通らなくなってインターフェイスが微妙になってしまう、
全部再実装がいるしarrayaccessが通らなくなって不便なのでやめた
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
abstractにするとhxUnserializeでthisを代入出来ない