Uploaded image for project: 'Swift'
  1. Swift
  2. SR-13208

LLDB fails to evaluate expressions inside class-bound protocol extensions

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Component/s: LLDB for Swift
    • Labels:
      None

      Description

      LLDB fails to run any expression inside a default implementation of a class-bound protocol where there are no references to self.

      Minimal example :

      class C : CP {}
      
      protocol CP : class {
        func foo()
      }
      extension CP {
        func foo() {
          print(1) // breakpoint here
        }
      }
      
      C().foo() 

      LLDB:

      b test.swift:8
      e 1 // (evaluate anything here) 

      Output:

      error: <EXPR>:4:3: error: 'mutating' isn't valid on methods in classes or class-bound protocols
        mutating func $__lldb_wrapped_expr_0(_ $__lldb_arg : UnsafeMutablePointer<Any>) {
        ^~~~~~~~~ 

        Attachments

          Activity

            People

            Assignee:
            Unassigned
            Reporter:
            augusto2112 Augusto Noronha
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated: