Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New update is not compilable #19

Open
alexs555 opened this issue Feb 17, 2016 · 5 comments
Open

New update is not compilable #19

alexs555 opened this issue Feb 17, 2016 · 5 comments

Comments

@alexs555
Copy link

Hello!
Today I stuck with an issue after swift-2-old branch was dropped. Some Mirror's declaration don't work anymore, Ex:

  1. let itemMirror: Mirror? doesnt compile
    https://gyazo.com/b5efc0486eaf7db664f5353661c4772b

if let value = itemMirror[param] where value is String {
return value as? String
} (type Mirror doesn't have subscript members))
https://gyazo.com/9547f3b03852993d1d49b675ad0f3a44

What can be the reason? Thank you.

@kostiakoval
Copy link
Owner

Hi, thanks for reporting issue. Is it possible to actually see the code so I can try to fix it?

1 issue:

The mirror is generic type. Try Mirror?

2 Issue

Yes the subscript operator was disable for now because of new API in Swift.Mirror reflection API. It should be fixed very soon.
I'm sorry for that troubles

@alexs555
Copy link
Author

Take a look at screenshots attached.
Is it possible to make an Mirror var as a field in struct?

@kostiakoval
Copy link
Owner

I think it should be possible, don't see any reason why it shouldn't work

@alexs555
Copy link
Author

Is it possible also to return back swift-2-old branch where subscripts worked?

@kostiakoval
Copy link
Owner

I'm sorry but that branch was completely wrong and borken. That's why it was deleted.

Can you please check swift-2.0 branch.
The subscript should work there.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants