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

ManagedAtomic doesn't seem to work in test-cases #112

Open
2 tasks done
ThrudTheBarbarian opened this issue Apr 13, 2024 · 0 comments
Open
2 tasks done

ManagedAtomic doesn't seem to work in test-cases #112

ThrudTheBarbarian opened this issue Apr 13, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@ThrudTheBarbarian
Copy link

ThrudTheBarbarian commented Apr 13, 2024

If I have an I-var of a ManagedAtomic in a Swift framework, and then set up a test case in the same Xcode project, in the associated test target created by Xcode. Even importing "@testable" won't let me extend the class that contained the ManagedAtomic. It returns

"Cannot inherit from class 'QSEntity' because it has overridable members that could not be loaded"

Information

  • Package version: 1.2.0
  • Platform version: MacOS 14.3 (23D56)
  • Swift version:
swift-driver version: 1.87.3 Apple Swift version 5.9.2 (swiftlang-5.9.2.2.56 clang-1500.1.0.2.5)
Target: arm64-apple-macosx14.0

Checklist

  • If possible, I've reproduced the issue using the main branch of this package.
  • I've searched for existing reports of the same issue.

Steps to Reproduce

  • Set up a Swift framework project
  • Include the ManagedAtomics package using the package manager
  • Have a class with the following:
/*****************************************************************************\
|* Class definition
\*****************************************************************************/
class QSEntity : NSObject
	{
        ...
	/*************************************************************************\
	|* Model handling
	\*************************************************************************/
	private var nextModelIdValue : ManagedAtomic<Int64>	// Table's next model-id
        ...
        }
  • Set up a class in the associated tests project which imports the framework and extends the above Entity class
import Foundation
import OSLog
@testable import QuickSilver

/*****************************************************************************\
|* Class definition
\*****************************************************************************/
class TestEntity : QSEntity
        {
        }

Expected behavior

I'd expect a class containing a ManagedAtomic as an i-var to be importable into another class in the associated test target

Actual behavior

  • Set up as above
  • Notice that the error message Cannot inherit from class 'QSEntity' because it has overridable members that could not be loaded appears on the TestEntity declaration line.
  • Comment out the ManagedAtomic from the QSEntity class, ignoring any compilation issues where you've used it (for now)
  • Notice that the "Cannot inherit..." error goes away
@ThrudTheBarbarian ThrudTheBarbarian added the bug Something isn't working label Apr 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant