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

Linker step fails when subclassing a class with a 'public private(set) var'

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Done
    • Component/s: Compiler, XCTest
    • Labels:
    • Environment:
      • Ubuntu 15.10, Linux x86_64
      • Swift commit 4c57791 (Sat Apr 2 10:46:18 2016 -0700)

      Description

      Pull request https://github.com/apple/swift/pull/2039 adds tests demonstrating the problem. Namely, the following test fails on Linux:

      // test/Parse/Inputs/public_var_private_setter.swift
      public class BaseClass {
             public internal(set) var variable: Int = 0
      }
      
      // test/Parse/use_public_var_private_setter.swift
      // RUN: %target-build-swift -emit-module -emit-library %S/Inputs/public_var_private_setter.swift
      // RUN: %target-build-swift -I . -L . -lpublic_var_private_setter %s -o use_public_var_private_setter
      
      // On Linux, the linker step of this test fails with "Bad value", specifically:
      // "hidden symbol `_TFC25public_var_private_setter9BaseClasscfT_S0_' isn't defined".
      // XFAIL: linux
      
      import public_var_private_setter
      
      class Class: BaseClass {}
      

      This is the underlying issue behind https://bugs.swift.org/browse/SR-272, and behind this workaround in swift-corelibs-xctest: https://github.com/apple/swift-corelibs-xctest/blob/db3643a469bea4faab3e2d23170cddb25c364662/Sources/XCTest/XCTestCase.swift#L30-L33

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                eeckstein Erik Eckstein
                Reporter:
                modocache Brian Ivan Gesiak
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: