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-12000] Swift 5.2 compiler ObjC bridging regression #54435

Closed
Agarunov opened this issue Jan 9, 2020 · 2 comments
Closed

[SR-12000] Swift 5.2 compiler ObjC bridging regression #54435

Agarunov opened this issue Jan 9, 2020 · 2 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior. compiler The Swift compiler in itself regression SILGen Area → compiler: The SIL generation stage swift 5.2

Comments

@Agarunov
Copy link

Agarunov commented Jan 9, 2020

Previous ID SR-12000
Radar rdar://problem/58455443
Original Reporter @Agarunov
Type Bug
Status Resolved
Resolution Done

Attachment: Download

Environment

Xcode 11.3

Toolchain: Swift 5.2 Snapshot 2020-01-06 (a)

Additional Detail from JIRA
Votes 1
Component/s Compiler
Labels Bug, 5.2Regression, SILGen
Assignee None
Priority Medium

md5: 5d6df9ba76f0ac136087d7a51864c8fb

Issue Description:

Abort trap 6 with this files:

// ObjcFoo.h

#import <Foundation/Foundation.h>

@interface ObjcFoo : NSObject

@property(nonatomic, readonly, nonnull) NSMutableArray *array;

@end
// ObjcFoo.m

#import "ObjcFoo.h"

@implementation ObjcFoo 

@end
// SwiftFoo.swift

import Foundation


class Value {

}

enum BarEnum {
    case first(Value)
    case second
}

final class SwiftFoo: ObjcFoo {
    
    func doSomething() {
        let value = BarEnum.second
        array.add(value)
        // Abort trap: 6
        // Assertion failed: (v.getType().isTrivial(SGF.F) || v.hasCleanup()), function emitNativeToCBridgedNonoptionalValue, file /Users/buildnode/jenkins/workspace/oss-swift-5.2-package-osx/swift/lib/SILGen/SILGenBridging.cpp, line 733.
    }
    
}

If you change Value type from class to struct/enum then there is no compilation error

@beccadax
Copy link
Contributor

beccadax commented Jan 9, 2020

@swift-ci create

@slavapestov
Copy link
Member

#29203

@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 regression SILGen Area → compiler: The SIL generation stage swift 5.2
Projects
None yet
Development

No branches or pull requests

4 participants