1

I am trying to unsafe cast an UIImageView in LLDB. I am getting the error: unknown type name 'let'. Here is a screen shot error: unknown type name

I have tried importing UIkit

expr -l Swift -- import UIKit 

but it does not fix the issue.

2
  • Compare stackoverflow.com/a/38905566/1187415. – And it is .self, not .safe Commented Dec 14, 2016 at 20:11
  • Comparison has been made before posting the question, hence the mention of expr -l Swift -- import UIKit not working. Commented Dec 15, 2016 at 2:16

1 Answer 1

3

It looks to me like you are trying to evaluate a swift expression when not stopped in a Swift frame. lldb guesses the appropriate language to use for expressions from the language of the current frame. If this were C then "let" is in the position to be a type name, making sense of the error.

What happens if you do:

(lldb) expr -l swift --

You can force all expressions to be run as swift expressions using:

(lldb) settings set target.language swift

if that suits your purposes better.

Sign up to request clarification or add additional context in comments.

1 Comment

(lldb) expr -l swift -- Enter expressions, then terminate with an empty line to evaluate: 1 I do not know what happened but after restarting the application I can not replicate the problem.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.