[TIMOB-23899] Hyperloop: iOS - Swift metabase parser can't handle open access level keyword
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | High |
| Status | Closed |
| Resolution | Fixed |
| Resolution Date | 2017-05-03T07:28:18.000+0000 |
| Affected Version/s | n/a |
| Fix Version/s | Hyperloop 2.1.1 |
| Components | Hyperloop, iOS |
| Labels | hyperloop, ios, metabase, swift |
| Reporter | Brian García |
| Assignee | Jan Vennemann |
| Created | 2016-09-12T14:01:16.000+0000 |
| Updated | 2017-05-31T16:22:21.000+0000 |
Description
When adding this swift file ([https://github.com/Ramotion/folding-cell]) in the src directory and referencing it in appc.js metabase fails to generate with the following error:
{noformat}
2016-09-12T13:56:50.382Z | ERROR | An uncaught exception was thrown!
Cannot read property '1' of null
2016-09-12T13:56:50.383Z | ERROR | Cannot read property '1' of null
{noformat}
Can you attach the swift-file? I can only find the demo-files around it. And please also attach the (zipped) generated metabase and a full trace-log. Thx!
of course! here you have : [https://mega.nz/#!udMQzJgQ]
I think [~jvennemann] is currently working on this, together with other Swift-related tickets. Moving it to the upcoming sprint.
Investigated a little and this is caused by the the new
openaccess level keyword introduced in Swift 3. Our swift metabase parser currently only checks for declarations withpublicaccess level.PR (master): https://github.com/appcelerator/hyperloop.next/pull/163 PR (2_1_X): https://github.com/appcelerator/hyperloop.next/pull/164 [~hansknoechel], see the above PRs for a fix to support the
openaccess level keyword. However, the Swift metabase parser has some more issues with the mentioned Swift file regarding proper type resolution. I don't think we should invest more time to solve this for the current Swift metabase parser and rather focus on the rewrite in TIMOB-24632.*Steps for FR* 1. Edit the
src/MySwift.swiftfile from the [hyperloop-examples](https://github.com/appcelerator/hyperloop-examples) project and replace thepublickeyword withopen2. Run the app and open the Custom Class view. *Expected behavior* The build should succeed and the view inside the app should show the Swift logo.Node Version: 6.10.1 NPM Version: 3.10.10 Mac OS: 10.12.4 Appc CLI: 6.2.2 Appc CLI NPM: 4.2.9 Titanium SDK version: 6.1.0.GA Appcelerator Studio, build: 4.9.0.201705251638 Xcode 8.3.2 Hyperloop 2.1.1 I followed the steps in the description using the above environment, and confirmed that I get the expected behavior.