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

[SR-11096] Abort 6: Property wrapper with closure argument with default value #53491

Closed
Agarunov opened this issue Jul 10, 2019 · 4 comments
Closed
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself property wrappers Feature: property wrappers

Comments

@Agarunov
Copy link

Previous ID SR-11096
Radar None
Original Reporter @Agarunov
Type Bug
Status Resolved
Resolution Duplicate
Environment

Xcode 11.0 beta 3 (11M362v)

Toolchain: Swift 5.1 Snapshot 2019-07-09 (a)

Additional Detail from JIRA
Votes 0
Component/s Compiler
Labels Bug, PropertyWrappers
Assignee None
Priority Medium

md5: ffd2fc4a04119e282049708ae9c30806

duplicates:

  • SR-11059 Abort 6: Property wrapper with default value in initialiser

Issue Description:

This code crashes:

class SomeValue {
    @SomeA var some: Int = 100
}


@propertyWrapper
struct SomeA<T> {
    var wrappedValue: T
    let closure: (T) -> (T)

    init(initialValue: T, closure: @escaping (T) -> (T) = { $0 }) { // problem with closure argument default value
        self.wrappedValue = initialValue
        self.closure = closure
    }
}
SIL verification failed: return value type does not match return type of function: functionResultType == instResultType
0  swift                    0x000000010c42e9b5 llvm::sys::PrintStackTrace(llvm::raw_ostream&) + 37
1  swift                    0x000000010c42dca5 llvm::sys::RunSignalHandlers() + 85
2  swift                    0x000000010c42ef98 SignalHandler(int) + 264
3  libsystem_platform.dylib 0x00007fff65206b5d _sigtramp + 29
4  libsystem_platform.dylib 0x00007ffa23e92970 _sigtramp + 3200826928
5  libsystem_c.dylib        0x00007fff650c06a6 abort + 127
6  swift                    0x0000000109408df8 (anonymous namespace)::SILVerifier::_require(bool, llvm::Twine const&, std::__1::function<void ()> const&) + 616
7  swift                    0x000000010941c21c swift::SILInstructionVisitor<(anonymous namespace)::SILVerifier, void>::visit(swift::SILInstruction*) + 67196
8  swift                    0x000000010940a92c (anonymous namespace)::SILVerifier::visitSILBasicBlock(swift::SILBasicBlock*) + 1484
9  swift                    0x00000001094055c7 swift::SILFunction::verify(bool) const + 7303
10 swift                    0x0000000108eb8fcd swift::Lowering::SILGenModule::postEmitFunction(swift::SILDeclRef, swift::SILFunction*) + 205
11 swift                    0x0000000108ec19f6 swift::Lowering::SILGenModule::emitStoredPropertyInitialization(swift::PatternBindingDecl*, unsigned int)::$_6::operator()(swift::SILFunction*) const + 422
12 swift                    0x0000000108ebb808 swift::Lowering::SILGenModule::emitStoredPropertyInitialization(swift::PatternBindingDecl*, unsigned int) + 536
13 swift                    0x0000000108f8b16d (anonymous namespace)::SILGenType::emitType() + 381
14 swift                    0x0000000108f8afe9 swift::Lowering::SILGenModule::visitNominalTypeDecl(swift::NominalTypeDecl*) + 25
15 swift                    0x0000000108ebdba6 swift::Lowering::SILGenModule::emitSourceFile(swift::SourceFile*) + 822
16 swift                    0x0000000108ebea05 swift::SILModule::constructSIL(swift::ModuleDecl*, swift::SILOptions&, swift::FileUnit*) + 293
17 swift                    0x0000000108ebef26 swift::performSILGeneration(swift::FileUnit&, swift::SILOptions&) + 38
18 swift                    0x0000000108be454f performCompile(swift::CompilerInstance&, swift::CompilerInvocation&, llvm::ArrayRef<char const*>, int&, swift::FrontendObserver*, swift::UnifiedStatsReporter*) + 8255
19 swift                    0x0000000108be15ea swift::performFrontend(llvm::ArrayRef<char const*>, char const*, void*, swift::FrontendObserver*) + 3002
20 swift                    0x0000000108b8a1b8 main + 696
21 libdyld.dylib            0x00007fff6501b3d5 start + 1
22 libdyld.dylib            0x000000000000006d start + 2600357017
// code placeholder
@Agarunov
Copy link
Author

Hm, maybe this issue is similar to SR-11059 also reported by me

@belkadan
Copy link
Contributor

It seems to be fixed on master, so very possibly. @DougGregor?

@DougGregor
Copy link
Member

Yeah, I think it's the same as https://bugs.swift.org/browse/SR-11059.

@Agarunov
Copy link
Author

Agarunov commented Aug 9, 2019

@DougGregor

this issue is fixed in latest master, but not in latest swift 5.1 toolchain (25.07.2019).

Same with SR-11059

@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself property wrappers Feature: property wrappers
Projects
None yet
Development

No branches or pull requests

3 participants