Open swift-ci opened 8 years ago
I'm not seeing this on master on a Mac, and I don't see anything Linux-specific, so it's possible this has been fixed.
Comment by Terry Latanville (JIRA)
If you declare a RawRepresentable initializer the problem presents itself on Linux using the swiftdocker/swift container (while compiling correctly on Mac):
public struct Foo: OptionSet, RawRepresentable {
public let rawValue: Int
public init(rawValue: Foo.RawValue) {
self.rawValue = rawValue
}
}
Changing the initializer's type to "Int" causes it to compile OK on Linux.
Huh, I can't see what would be different about that on Linux.
What version of Swift is in the swiftdocker container? "fixed on master" in December would mean "fixed in 3.1" now, and 3.1 just came out, so it wouldn't be surprising if you're still seeing this.
Comment by Terry Latanville (JIRA)
Seems to be 3.1, but I'll give it another try.
ARG SWIFT_PLATFORM=ubuntu16.04
ARG SWIFT_BRANCH=swift-3.1-release
ARG SWIFT_VERSION=swift-3.1-RELEASE
Comment by Terry Latanville (JIRA)
OK if you specify swiftdocker/swift:latest you get the following version:
Swift version 3.0.2 (swift-3.0.2-RELEASE)
Target: x86_64-unknown-linux-gnu
If you specify swiftdocker/swift:swift-3.1
Swift version 3.1-dev (LLVM a7c680da51, Clang 9772bf511a, Swift ce937d9373)
Target: x86_64-unknown-linux-gnu
If you use the swift-3.1 branch the build completes successfully.
Environment
Linux breder 2.6.32-042stab113.21 \#1 SMP Wed Mar 23 11:05:25 MSK 2016 x86_64 x86_64 x86_64 GNU/Linux Swift version 3.0.1 (swift-3.0.1-RELEASE) Target: x86_64-unknown-linux-gnu Swift Package Manager - Swift 3.0.1Additional Detail from JIRA
| | | |------------------|-----------------| |Votes | 0 | |Component/s | Compiler | |Labels | Bug, CompilerCrash | |Assignee | None | |Priority | Medium | md5: bc21e6c2e78a02e7b47e4dc263c041d2Issue Description:
I have a error from swift compiler at linux in my swift project using package manager:
~$ mkdir test ~$ cd test/ ~/test$ swift package init Creating library package: test Creating Package.swift Creating .gitignore Creating Sources/ Creating Sources/test.swift Creating Tests/ Creating Tests/LinuxMain.swift Creating Tests/testTests/ Creating Tests/testTests/testTests.swift ~/test$ vi Sources/test.swift ~/test$ cat Sources/test.swift public protocol A {
}
public protocol A1 {
}
open class B: A {
}
open class C: B, A1 {
} ~/test$ swift build Compile Swift Module 'test' (1 sources) swift: /home/buildnode/disk2/workspace/oss-swift-3.0-package-linux-ubuntu-16_04/swift/lib/AST/Decl.cpp:1661: void swift::ValueDecl::setType(swift::Type): Assertion `!hasType() && "changing type of declaration"' failed. 0 swift 0x0000000003350548 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 40 1 swift 0x000000000334ed46 llvm::sys::RunSignalHandlers() + 54 2 swift 0x0000000003351076 3 libpthread.so.0 0x00007f4d289b83e0 4 libc.so.6 0x00007f4d27300428 gsignal + 56 5 libc.so.6 0x00007f4d2730202a abort + 362 6 libc.so.6 0x00007f4d272f8bd7 7 libc.so.6 0x00007f4d272f8c82 8 swift 0x00000000010faffc swift::ValueDecl::setType(swift::Type) + 92 9 swift 0x0000000000eccadd swift::configureConstructorType(swift::ConstructorDecl*, swift::Type, swift::Type) + 365 10 swift 0x0000000000edf7f5 11 swift 0x0000000000ed15cd 12 swift 0x0000000000edd9eb 13 swift 0x0000000000ed159d 14 swift 0x0000000000ed1406 swift::TypeChecker::typeCheckDecl(swift::Decl*, bool) + 150 15 swift 0x0000000000ef4bc2 swift::performTypeChecking(swift::SourceFile&, swift::TopLevelContext&, swift::OptionSet<swift::TypeCheckingFlags, unsigned int>, unsigned int, unsigned int) + 1026 16 swift 0x0000000000c7ee1b swift::CompilerInstance::performSema() + 3515 17 swift 0x00000000007dbeaf 18 swift 0x00000000007daf81 swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 2833 19 swift 0x00000000007a7a1b main + 2603 20 libc.so.6 0x00007f4d272eb830 __libc_start_main + 240 21 swift 0x00000000007a5599 _start + 41 Stack dump:
To resolve the problem and continue to work, i make a change at construtor of classe B:
~/test$ vi Sources/test.swift ~/test$ cat Sources/test.swift public protocol A {
}
public protocol A1 {
}
open class B: A {
}
open class C: B, A1 {
} git@breder:~/test$ swift build Compile Swift Module 'test' (1 sources)