We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Swift 5.3.3-RELEASE on Ubuntu 20.04
md5: 37147dd19c120d6292c0a4b518293fed
Issue Description:
Place the following content into a file called test.swift.
test.swift
final class MyType { var count: Int = 55 } @_cdecl("mytype_create") public func mytype_create() -> OpaquePointer { let type = MyType() let retained = Unmanaged.passRetained(type).toOpaque() return OpaquePointer(retained) } @_cdecl("mytype_get_count") public func mytype_create(_ type: OpaquePointer) -> CInt { let type = Unmanaged<MyType>.fromOpaque(UnsafeRawPointer(type)).takeUnretainedValue() return CInt(type.count) }
Attempt to compile with swiftc -emit-objc-header-path test.h test.swift.
swiftc -emit-objc-header-path test.h test.swift
This triggers the following assertion:
swift: /home/buildnode/jenkins/workspace/oss-swift-5.3-package-linux-ubuntu-16_04/swift/lib/PrintAsObjC/ModuleContentsWriter.cpp:503: auto (anonymous namespace)::ModuleWriter::write()::(anonymous class)::operator()(swift::Decl *const *, swift::Decl *const *) const: Assertion `!(isa<ValueDecl>(*lhs) && isa<ValueDecl>(*rhs))' failed. Stack dump: 0. Program arguments: /usr/bin/swift -frontend -merge-modules -emit-module /tmp/test-e4af15.swiftmodule -parse-as-library -sil-merge-partial-modules -disable-diagnostic-passes -disable-sil-perf-optzns -target x86_64-unknown-linux-gnu -disable-objc-interop -color-diagnostics -emit-module-doc-path test.swiftdoc -emit-module-source-info-path test.swiftsourceinfo -emit-objc-header-path test.h -module-name test -o test.swiftmodule 1. Swift version 5.3.3 (swift-5.3.3-RELEASE) 2. While generating Objective-C header /usr/bin/swift[0x50aee34] /usr/bin/swift[0x50ace00] /usr/bin/swift[0x50af11a] /lib/x86_64-linux-gnu/libpthread.so.0(+0x11390)[0x7fba52cfe390] /lib/x86_64-linux-gnu/libc.so.6(gsignal+0x38)[0x7fba5142b438] /lib/x86_64-linux-gnu/libc.so.6(abort+0x16a)[0x7fba5142d03a] /lib/x86_64-linux-gnu/libc.so.6(+0x2dbe7)[0x7fba51423be7] /lib/x86_64-linux-gnu/libc.so.6(+0x2dc92)[0x7fba51423c92] /usr/bin/swift[0x699d40] /lib/x86_64-linux-gnu/libc.so.6(+0x39242)[0x7fba5142f242] /lib/x86_64-linux-gnu/libc.so.6(qsort_r+0x3cf)[0x7fba5142f6af] /usr/bin/swift[0x6988a7] /usr/bin/swift[0x69688f] /usr/bin/swift[0x54450e] /usr/bin/swift[0x1a9800b] /usr/bin/swift[0x540036] /usr/bin/swift[0x57e411] /usr/bin/swift[0x587bcf] /usr/bin/swift[0x57b322] /usr/bin/swift[0x5780ef] /usr/bin/swift[0x501c2c] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7fba51416840] /usr/bin/swift[0x5017a9] <unknown>:0: error: unable to execute command: Aborted <unknown>:0: error: merge-module command failed due to signal 6 (use -v to see invocation)
The text was updated successfully, but these errors were encountered:
I believe this is caused by having declared a pair of functions that overload in Swift, but that have different `cdecl` qualifiers.
Sorry, something went wrong.
That sounds right. This reproduces on macOS, but goes away if I change the Swift name of the second function to anything else.
@swift-ci create
No branches or pull requests
Environment
Swift 5.3.3-RELEASE on Ubuntu 20.04
Additional Detail from JIRA
md5: 37147dd19c120d6292c0a4b518293fed
Issue Description:
Place the following content into a file called
test.swift
.Attempt to compile with
swiftc -emit-objc-header-path test.h test.swift
.This triggers the following assertion:
The text was updated successfully, but these errors were encountered: