My favorites | Sign in
Project Home Wiki Issues Source
READ-ONLY: This project has been archived. For more information see this post.
Search
for
  Advanced search   Search tips   Subscriptions
Issue 220: ‘class Array_obj’ has no member named ‘map’
1 person starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  gameh...@gmail.com
Closed:  Feb 2013


 
Reported by andy@onthewings.net, Jan 18, 2013
Using haxe r5897, hxcpp r629, the following code produce the attached error:

using Lambda;

class Main
{	
    public static function main():Void {
		["1"].map(Std.parseInt);
    }
}

./src/Main.cpp: In static member function ‘static Void Main_obj::main()’: ./src/Main.cpp:32: error: ‘class Array_obj’ has no member named ‘map’ Called from ? line 1 Called from BuildTool.hx line 1448 Called from BuildTool.hx line 667 Called from a C function Called from BuildTool.hx line 702 Called from BuildTool.hx line 836 Called from BuildTool.hx line 883 Called from BuildTool.hx line 244 Uncaught exception - Error : 1 - build cancelled Error : Build failed
Jan 18, 2013
#1 andy@onthewings.net
Oh, the reason is map() was added to Array in haxe r5877 ( https://code.google.com/p/haxe/source/detail?r=5877 ). So "using Lambda;" is redundant now but the map/filter function is not added in cpp target.
Jan 27, 2013
#2 andy@onthewings.net
Before hxcpp implements the two method, one can workaround by wrapping the map/filter methods in Array.hx like:

	#if !cpp
	function map<S>( f : T -> S ) : Array<S>;
	function filter( f : T -> Bool ) : Array<T>;
	#end
Jan 30, 2013
Project Member #3 si...@haxe.org
Filter is easy, but how to handle the type parameter of S?
Status: Accepted
Owner: gameh...@gmail.com
Labels: -Priority-Medium Priority-High
Feb 1, 2013
Project Member #4 gameh...@gmail.com
Fixed
Status: Fixed

Powered by Google Project Hosting