Skip to content

error: cannot inherit from class 'NSLock' because it has overridable members that could not be loaded #870

Closed
@clackary

Description

@clackary

The following code snippet builds successfully with the 2024-07-15 nightly toolchain, but fails to build with 2024-07-22. I'm not sure how to check or verify this was caused by the switch to swift-foundation, but the timing seems to line up.

import Foundation

class FooLock: NSLock {}

Actual behavior:

/project/repro.swift:3:7: error: cannot inherit from class 'NSLock' because it has overridable members that could not be loaded
1 | import Foundation
2 | 
3 | class FooLock: NSLock {}
  |       |- error: cannot inherit from class 'NSLock' because it has overridable members that could not be loaded
  |       `- note: could not deserialize 'mutex'
4 | 

Worth noting that it does seem specific to Linux, because the same snippet builds successfully with recent toolchains on macOS.

Expected behavior:
Code builds successfully.

Configuration:
OS: Linux Ubuntu 22.04
Toolchain: swift-DEVELOPMENT-SNAPSHOT-2024-07-22-a-ubuntu22.04-aarch64 or newer

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions