Created
November 8, 2013 15:24
-
-
Save skial/7372563 to your computer and use it in GitHub Desktop.
Abstract bug?
This file contains hidden or 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
package ; | |
using Lambda; | |
class Main { | |
public static function main() { | |
var a = ['a', 'b', 'c']; | |
var m:MyArray = a; | |
if (m['a']) trace( m['a'] ); | |
} | |
} | |
abstract MyArray(Array<String>) from Array<String> to Array<String> { | |
public function new(v:Array<String>) this = v; | |
@:arrayAccess public function exists(v:String):Bool return this.indexOf(v) > -1; | |
@:arrayAccess public function get(v:String):String return this[this.indexOf(v)]; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment