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

Index does not include reference to constructor of class/struct with generic types

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Medium
    • Resolution: Unresolved
    • Component/s: Source Tooling
    • Labels:
      None
    • Environment:

      Description

      Given the following code:

       

      class ClassA<T> {
          init(someVar: Int = 0) {}
      }
      
      class ClassB {
          private let classA: ClassA<String>
      
          init() {
              classA = ClassA<String>()
          }
      }
      

       

      A source.request.indexsource response does not include a source.lang.swift.ref.function.constructor reference for ClassA<String>() to the declaration init(someVar:). The constructor has the USR s:4test6ClassACACyxGSi7someVar_tcfc and it is not referenced anywhere in the index.

       

      This issue appears to only affect classes with generic types. If I remove the generic type from ClassA, the ClassB constructor declaration will contain a reference to init(someVar:).

       

      Full index response is here: https://gist.github.com/ileitch/2b6b08ab247d712da752c5c24b5fca85

       

      /cc Xi Ge Ben Langmuir

       

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            Leitch Ian Leitch
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated: