{"action":"created","issue":{"url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/4843","repository_url":"https://api.github.com/repos/HaxeFoundation/haxe","labels_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/4843/labels{/name}","comments_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/4843/comments","events_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/4843/events","html_url":"https://github.com/HaxeFoundation/haxe/issues/4843","id":132870847,"number":4843,"title":"Object requires field iterator (ufront TemplateData)","user":{"login":"kevinresol","id":1103788,"avatar_url":"https://avatars.githubusercontent.com/u/1103788?v=3","gravatar_id":"","url":"https://api.github.com/users/kevinresol","html_url":"https://github.com/kevinresol","followers_url":"https://api.github.com/users/kevinresol/followers","following_url":"https://api.github.com/users/kevinresol/following{/other_user}","gists_url":"https://api.github.com/users/kevinresol/gists{/gist_id}","starred_url":"https://api.github.com/users/kevinresol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevinresol/subscriptions","organizations_url":"https://api.github.com/users/kevinresol/orgs","repos_url":"https://api.github.com/users/kevinresol/repos","events_url":"https://api.github.com/users/kevinresol/events{/privacy}","received_events_url":"https://api.github.com/users/kevinresol/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/HaxeFoundation/haxe/labels/regression","name":"regression","color":"e11d21"}],"state":"open","locked":false,"assignee":{"login":"ncannasse","id":1022912,"avatar_url":"https://avatars.githubusercontent.com/u/1022912?v=3","gravatar_id":"","url":"https://api.github.com/users/ncannasse","html_url":"https://github.com/ncannasse","followers_url":"https://api.github.com/users/ncannasse/followers","following_url":"https://api.github.com/users/ncannasse/following{/other_user}","gists_url":"https://api.github.com/users/ncannasse/gists{/gist_id}","starred_url":"https://api.github.com/users/ncannasse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ncannasse/subscriptions","organizations_url":"https://api.github.com/users/ncannasse/orgs","repos_url":"https://api.github.com/users/ncannasse/repos","events_url":"https://api.github.com/users/ncannasse/events{/privacy}","received_events_url":"https://api.github.com/users/ncannasse/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/HaxeFoundation/haxe/milestones/5","html_url":"https://github.com/HaxeFoundation/haxe/milestones/3.3.0-rc1","labels_url":"https://api.github.com/repos/HaxeFoundation/haxe/milestones/5/labels","id":586975,"number":5,"title":"3.3.0-rc1","description":"","creator":{"login":"ncannasse","id":1022912,"avatar_url":"https://avatars.githubusercontent.com/u/1022912?v=3","gravatar_id":"","url":"https://api.github.com/users/ncannasse","html_url":"https://github.com/ncannasse","followers_url":"https://api.github.com/users/ncannasse/followers","following_url":"https://api.github.com/users/ncannasse/following{/other_user}","gists_url":"https://api.github.com/users/ncannasse/gists{/gist_id}","starred_url":"https://api.github.com/users/ncannasse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ncannasse/subscriptions","organizations_url":"https://api.github.com/users/ncannasse/orgs","repos_url":"https://api.github.com/users/ncannasse/repos","events_url":"https://api.github.com/users/ncannasse/events{/privacy}","received_events_url":"https://api.github.com/users/ncannasse/received_events","type":"User","site_admin":false},"open_issues":143,"closed_issues":149,"state":"open","created_at":"2014-03-04T14:22:27Z","updated_at":"2016-02-29T14:33:45Z","due_on":"2016-04-02T22:00:00Z","closed_at":null},"comments":26,"created_at":"2016-02-11T02:06:43Z","updated_at":"2016-02-29T15:22:28Z","closed_at":null,"body":"```haxe\r\npackage;\r\n\r\nimport haxe.ds.StringMap;\r\nusing StringTools;\r\n\r\nclass Main {\r\n\t\r\n\tpublic static function main()\r\n\t{\r\n\t\tvar d:TemplateData = {};\r\n\t}\r\n\t\r\n}\r\n\r\n\r\n\r\nabstract TemplateData({}) from {} to {} {\r\n\r\n\t/**\r\n\tCreate a template data object.\r\n\r\n\t@param obj The object to use.  If null a new TemplateData object with no values will be used.\r\n\t**/\r\n\tpublic inline function new( ?obj:{} )\r\n\t\tthis = (obj!=null) ? obj : {};\r\n\r\n\t/**\r\n\tConvert into a `Dynamic<Dynamic>` anonymous object.\r\n\tPlease note this is not an implicit `@:to` cast, because the resulting type would match too many false positives.\r\n\tTo use this cast call `templateData.toObject()` explicitly.\r\n\t**/\r\n\tpublic inline function toObject():Dynamic<Dynamic>\r\n\t\treturn this;\r\n\r\n\t/**\r\n\tConvert into a `Map<String,Dynamic>`.\r\n\tThis is also available as an implicit `@:to` cast.\r\n\t**/\r\n\t@:to public function toMap():Map<String,Dynamic> {\r\n\t\tvar ret = new Map<String,Dynamic>();\r\n\t\tfor ( k in Reflect.fields(this) ) ret[k] = Reflect.field( this, k );\r\n\t\treturn ret;\r\n\t}\r\n\r\n\t/**\r\n\tConvert into a `StringMap<Dynamic>`.\r\n\tThis is also available as an implicit `@:to` cast.\r\n\t**/\r\n\t@:to public inline function toStringMap():StringMap<Dynamic> {\r\n\t\treturn toMap();\r\n\t}\r\n\r\n\t/**\r\n\tGet a value from the template data.\r\n\r\n\tThis is also used for array access: `templateData['name']` is the same as `templateData.get('name')`.\r\n\r\n\t@param key The name of the value to retrieve.\r\n\t@return The value, or null if it was not available.\r\n\t**/\r\n\t@:arrayAccess public inline function get( key:String ):Null<Dynamic> return Reflect.field( this, key );\r\n\r\n\t/**\r\n\tSee if a specific field exists in the template data.\r\n\t**/\r\n\tpublic function exists( key:String ):Bool {\r\n\t\treturn Reflect.hasField( this, key );\r\n\t}\r\n\r\n\t/**\r\n\tSet a value on the template data.\r\n\r\n\tPlease note array setters are also available, but they use the private `array_set` method which returns the value, rather than the TemplateData object.\r\n\r\n\t@param key The name of the key to set.\r\n\t@param val The value to set.\r\n\t@return The same TemplateData so that method chaining is enabled.\r\n\t**/\r\n\tpublic function set( key:String, val:Dynamic ):TemplateData {\r\n\t\tReflect.setField( this, key, val );\r\n\t\treturn new TemplateData( this );\r\n\t}\r\n\r\n\t/** Array access setter. **/\r\n\t@:arrayAccess function array_set<T>( key:String, val:T ):T {\r\n\t\tReflect.setField( this, key, val );\r\n\t\treturn val;\r\n\t}\r\n\r\n\t/**\r\n\tSet many values from a `Map<String,Dynamic>`\r\n\r\n\t`templateData.set(key,map[key])` will be called for each pair in the map.\r\n\r\n\t@param map The map data to set.\r\n\t@return The same TemplateData so that method chaining is enabled.\r\n\t**/\r\n\tpublic function setMap<T>( map:Map<String,T> ):TemplateData {\r\n\t\tfor ( k in map.keys() ) {\r\n\t\t\tset( k, map[k] );\r\n\t\t}\r\n\t\treturn new TemplateData( this );\r\n\t}\r\n\r\n\t/**\r\n\tSet many values from an object.\r\n\r\n\t`templateData.set(fieldName,fieldValue)` will be called for each field or property on the object.\r\n\r\n\tThe behaviour differ depending on if this is an anonymous object or a class instance:\r\n\r\n\t- Anonymous objects will find all fields using `Reflect.fields()` and fetch the values using `Reflect.field()`.\r\n\t- Class instance objects will find all fields using `Type.getInstanceFields()` and fetch the values using `Reflect.getProperty()`.\r\n\t- Other values will be ignored.\r\n\r\n\tPlease note on PHP, objects that are class instances may fail to load fields that are functions.\r\n\r\n\t@param d The data object to set.\r\n\t@return The same TemplateData so that method chaining is enabled.\r\n\t**/\r\n\tpublic function setObject( d:{} ):TemplateData {\r\n\t\tswitch Type.typeof(d) {\r\n\t\t\tcase TObject:\r\n\t\t\t\tfor ( k in Reflect.fields(d) ) set( k, Reflect.field(d,k) );\r\n\t\t\tcase TClass(cls):\r\n\t\t\t\t#if php\r\n\t\t\t\t\t// PHP can't access properties on class instances using Reflect.getProperty, it throws an error.\r\n\t\t\t\t\t// These checks and fallbacks are not required on JS or neko. It might be good to submit a bug report.\r\n\t\t\t\t\tfor ( k in Type.getInstanceFields(cls) ) {\r\n\t\t\t\t\t\ttry set( k, Reflect.getProperty(d,k) )\r\n\t\t\t\t\t\tcatch ( e:Dynamic ) try set( k, Reflect.field(d,k) )\r\n\t\t\t\t\t\tcatch ( e:Dynamic ) {}\r\n\t\t\t\t\t}\r\n\t\t\t\t#else\r\n\t\t\t\t\tfor ( k in Type.getInstanceFields(cls) ) set( k, Reflect.getProperty(d,k) );\r\n\t\t\t\t#end\r\n\t\t\tcase _:\r\n\t\t}\r\n\t\treturn new TemplateData( this );\r\n\t}\r\n\r\n\t/** from casts **/\r\n\r\n\t/**\r\n\tAutomatically cast from a `Map<String,Dynamic>` into a TemplateData.\r\n\t**/\r\n\t@:from public static function fromMap<T>( d:Map<String,T> ):TemplateData {\r\n\t\tvar m:TemplateData = new TemplateData( {} );\r\n\t\tm.setMap( d );\r\n\t\treturn m;\r\n\t}\r\n\r\n\t/**\r\n\tAutomatically cast from a `StringMap<Dynamic>` into a TemplateData.\r\n\t**/\r\n\t@:from public static inline function fromStringMap<T>( d:StringMap<T> ):TemplateData {\r\n\t\treturn fromMap( d );\r\n\t}\r\n\r\n\t/**\r\n\tAutomatically cast from a `Iterable<TemplateData>` into a combined `TemplateData.\r\n\r\n\tValues will be added in order, and later values with the same name as an earlier value will override the earlier value.\r\n\r\n\tIf the iterable is empty, the resulting TemplateData will contain no properties.\r\n\r\n\tIf an individual item is a StringMap, it will be added with `setMap`, otherwise it will be added with `setObject`.\r\n\r\n\t@param dataSets The collection of TemplateData objects to iterate over.\r\n\t@return The same TemplateData so that method chaining is enabled.\r\n\t**/\r\n\t@:from public static function fromMany( dataSets:Iterable<TemplateData> ):TemplateData {\r\n\t\tvar combined:TemplateData = new TemplateData( {} );\r\n\t\tfor ( d in dataSets ) {\r\n\t\t\tif ( d!=null ) {\r\n\t\t\t\tif ( Std.is(d,StringMap) ) {\r\n\t\t\t\t\tvar map:StringMap<Dynamic> = cast d;\r\n\t\t\t\t\tcombined.setMap( (map:StringMap<Dynamic>) );\r\n\t\t\t\t}\r\n\t\t\t\telse {\r\n\t\t\t\t\tvar obj:Dynamic = d;\r\n\t\t\t\t\tcombined.setObject( obj );\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\treturn combined;\r\n\t}\r\n\r\n\t/**\r\n\tAutomatically cast from an object to a TemplateData.\r\n\r\n\tThis results in a new object, the equivalent of calling `new TemplateData().setObject( d )`.\r\n\r\n\tThis cast comes last in the code so it should be used only if none of the other casts were utilised.\r\n\t**/\r\n\t@:from public static inline function fromObject( d:{} ):TemplateData {\r\n\t\treturn null ; //new TemplateData( {} ).setObject( d );\r\n\t}\r\n}\r\n```\r\n\r\nThis does not work on latest build (3d001e0) but had been working in 3.2.1."},"comment":{"url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/comments/190255266","html_url":"https://github.com/HaxeFoundation/haxe/issues/4843#issuecomment-190255266","issue_url":"https://api.github.com/repos/HaxeFoundation/haxe/issues/4843","id":190255266,"user":{"login":"kevinresol","id":1103788,"avatar_url":"https://avatars.githubusercontent.com/u/1103788?v=3","gravatar_id":"","url":"https://api.github.com/users/kevinresol","html_url":"https://github.com/kevinresol","followers_url":"https://api.github.com/users/kevinresol/followers","following_url":"https://api.github.com/users/kevinresol/following{/other_user}","gists_url":"https://api.github.com/users/kevinresol/gists{/gist_id}","starred_url":"https://api.github.com/users/kevinresol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kevinresol/subscriptions","organizations_url":"https://api.github.com/users/kevinresol/orgs","repos_url":"https://api.github.com/users/kevinresol/repos","events_url":"https://api.github.com/users/kevinresol/events{/privacy}","received_events_url":"https://api.github.com/users/kevinresol/received_events","type":"User","site_admin":false},"created_at":"2016-02-29T15:22:27Z","updated_at":"2016-02-29T15:22:27Z","body":"As mentioned, I started a clean `haxe --wait` and run the build two times.\r\nThe first one is fine ,see the first few lines of the log up to \"Cache dump complete\", and the second build starts from there"}}