[Linux] Haxe's file compiling error. (Printer.hx)

  • Here is the error:

    /usr/share/haxe/std/haxe/xml/Printer.hx:113: characters 9-20 : Only inline or read-only (default, never) fields can be used as a pattern


    	function hasChildren(value:Xml):Bool { // 110. line
    		for (child in value) {
    			switch (child.nodeType) {
    				case Xml.Element, Xml.PCData: // 113. line [ERROR HERE]
    					return true;
    				case Xml.CData, Xml.Comment:
    					if (StringTools.ltrim(child.nodeValue).length != 0) {
    						return true;
    				case _:
    		return false;
    	} // 123. line

    Any solutions? Thanks!

  • I think you want to use XmlType.Element and not Xml.Element. XmlType is the enum, and Xml is the class. Although Xml does declare the same thing... Hmm. Why don't you try using XmlType.Element, and tell me if it works.

  • @Desttinghim this is not my class :D this is haxe's itself :) (I'm trying to change it...)

  • O_o I don't know then. The error doesn't make sense to me after looking at the sources.

  • @Desttinghim maybe it is about the compiler? Isn't there any haxeflixel developers using linux?

    You should install haxe from : http://www.openfl.org/download/

    1. Download tar.gz
    2. Extract
    3. (If you want to change version of haxe you can change by open install script with any text editor.)
    4. Run install script from terminal with sudo
    5. Finished!

    /usr/lib/haxe <- Haxe path.
    /usr/lib/haxe/lib <- Haxelib libraries path.

    Thanks to @alihassan very much!

Log in to reply

Looks like your connection to HaxeFlixel was lost, please wait while we try to reconnect.