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 186: switch statement with dynamic value breaks compilation on Mac
1 person starred this issue and may be notified of changes. Back to list
Status:  Fixed
Owner:  ----
Closed:  Jun 2012


 
Reported by tobias.r...@gmail.com, Jun 26, 2012
What steps will reproduce the problem?
1. Create a minimal NME example:

enum EFoo{
	BAR;
}
 
class TestSwitch extends Sprite {
	
	public function new () {
		super ();
		_checkSwitch();
	}
	
	private function _checkSwitch():Bool{
		
		var l_value:Dynamic = "test";
		switch( l_value )
		{
  			case EFoo.BAR : return true;
		}
	
	}
	public static function main () {
		Lib.current.addChild (new TestSwitch ());
	}	
}

2. Try to compile "nme test game.nmml mac" (I only have a Mac, it seems to works on Windows though)

What is the expected output? What do you see instead?
Expected: Compilation
Instead:
Error: error: ‘class hx::Object’ has no member named ‘GetIndex’
Error line points to the generated cpp file, directly at the switch statement.

Casting the l_value to EFoo before the switch statement makes it compile again.


What version of the product are you using? On what operating system?
hxcpp 2.09.3, nme 3.3.3

Please provide any additional information below.

It seems the problem is compilation on a Mac. Valerie Elimak posted at the awe6 google group that it works for her on a windows system. But on a Mac it also doesn't compile for Android or Blackberry targets.
Jun 27, 2012
Project Member #1 gameh...@gmail.com
This should be fixed on SVN now.  Although, as it is written here, you get a runtime error because l_value is not actually a EFoo.
Status: Fixed

Powered by Google Project Hosting