{"id":628,"date":"2018-06-02T21:56:48","date_gmt":"2018-06-02T21:56:48","guid":{"rendered":"http:\/\/www.onux.com\/jspp\/blog\/?p=628"},"modified":"2018-06-09T23:54:25","modified_gmt":"2018-06-09T23:54:25","slug":"js-0-8-5-bug-fix-release","status":"publish","type":"post","link":"https:\/\/www.onux.com\/jspp\/blog\/js-0-8-5-bug-fix-release\/","title":{"rendered":"JS++ 0.8.5: Bug Fix Release"},"content":{"rendered":"<p>This is a small bug fix release.<\/p>\n<p>The following minor issues have been fixed:<\/p>\n<ol>\n<li>Dictionary expression of empty arrays now has the correct type inferred<\/li>\n<li>Labels for foreach statements<\/li>\n<li>Type inference for System.Array.reduce<\/li>\n<li>Function inlining for System.String methods: padRight(int), padLeft(int), startsWith, endsWith<\/li>\n<\/ul>\n<\/ol>\n<p>Issue #1:<\/p>\n<pre class=\"brush:jspp\">\r\nDictionary&lt;unsigned int[]&gt; x = {\r\n    \"foo\": (unsigned int[]) [],\r\n    \"bar\": (unsigned int[]) []\r\n};\r\n<\/pre>\n<p>The casts were previously required in 0.8.4, but, in the latest release, casting of empty arrays is no longer necessary.<\/p>\n<p>Issue #2:<\/p>\n<pre class=\"brush:jspp\">\r\nouterLoop: foreach (var row in json) {\r\n    \/\/ ...\r\n\r\n    foreach(var cell in row.Cell) {\r\n        \/\/ ...\r\n        continue outerLoop;\r\n    }\r\n}\r\n<\/pre>\n<p>Issue #3:<\/p>\n<pre class=\"brush:jspp\">\r\nstring[] keys = dict.keys();\r\nint x = keys.reduce(\r\n    int(string previous \/* type of 'previous' param *\/, string current) {\r\n    },\r\n    0 \/\/ and this type\r\n);\r\n<\/pre>\n<p>In the above case, the two types must match. However, the type checker was inferring &#8216;external&#8217; instead. This has been fixed in the latest release.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This is a small bug fix release. The following minor issues have been fixed: Dictionary expression of empty arrays now has the correct type inferred Labels for foreach statements Type inference for System.Array.reduce Function inlining for System.String methods: padRight(int), padLeft(int), startsWith, endsWith Issue #1: Dictionary&lt;unsigned int[]&gt; x = { &#8220;foo&#8221;: (unsigned int[]) [], &#8220;bar&#8221;: (unsigned &hellip; <a href=\"https:\/\/www.onux.com\/jspp\/blog\/js-0-8-5-bug-fix-release\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;JS++ 0.8.5: Bug Fix Release&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[2,4],"tags":[],"_links":{"self":[{"href":"https:\/\/www.onux.com\/jspp\/blog\/wp-json\/wp\/v2\/posts\/628"}],"collection":[{"href":"https:\/\/www.onux.com\/jspp\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.onux.com\/jspp\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.onux.com\/jspp\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.onux.com\/jspp\/blog\/wp-json\/wp\/v2\/comments?post=628"}],"version-history":[{"count":8,"href":"https:\/\/www.onux.com\/jspp\/blog\/wp-json\/wp\/v2\/posts\/628\/revisions"}],"predecessor-version":[{"id":636,"href":"https:\/\/www.onux.com\/jspp\/blog\/wp-json\/wp\/v2\/posts\/628\/revisions\/636"}],"wp:attachment":[{"href":"https:\/\/www.onux.com\/jspp\/blog\/wp-json\/wp\/v2\/media?parent=628"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.onux.com\/jspp\/blog\/wp-json\/wp\/v2\/categories?post=628"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.onux.com\/jspp\/blog\/wp-json\/wp\/v2\/tags?post=628"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}