Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-23899] Hyperloop: iOS - Swift metabase parser can't handle open access level keyword

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2017-05-03T07:28:18.000+0000
Affected Version/sn/a
Fix Version/sHyperloop 2.1.1
ComponentsHyperloop, iOS
Labelshyperloop, ios, metabase, swift
ReporterBrian García
AssigneeJan Vennemann
Created2016-09-12T14:01:16.000+0000
Updated2017-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}

Comments

  1. Hans Knöchel 2016-09-13

    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!
  2. Brian García 2016-09-13

    of course! here you have : [https://mega.nz/#!udMQzJgQ]
  3. Hans Knöchel 2016-11-18

    I think [~jvennemann] is currently working on this, together with other Swift-related tickets. Moving it to the upcoming sprint.
  4. Jan Vennemann 2016-11-21

    Investigated a little and this is caused by the the new open access level keyword introduced in Swift 3. Our swift metabase parser currently only checks for declarations with public access level.
  5. Jan Vennemann 2017-04-26

    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 open access 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.
  6. Jan Vennemann 2017-05-26

    *Steps for FR* 1. Edit the src/MySwift.swift file from the [hyperloop-examples](https://github.com/appcelerator/hyperloop-examples) project and replace the public keyword with open 2. 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.
  7. Abir Mukherjee 2017-05-31

    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.

JSON Source