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-14080] Generic property wrapper assertion failure in development snapshot #56469

Closed
xAlien95 opened this issue Jan 21, 2021 · 3 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

@xAlien95
Copy link
Contributor

Previous ID SR-14080
Radar rdar://70238041
Original Reporter @xAlien95
Type Bug
Status Closed
Resolution Done

Attachment: Download

Environment

Xcode 12.3 (12C33)
swift-DEVELOPMENT-SNAPSHOT-2021-01-19-a.xtoolchain
Target: x86_64-apple-darwin20.2.0

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

md5: 0c71cf519666c9a0840cc782b489aebf

Issue Description:

Consider the following code snippet:

@propertyWrapper enum A {
  var wrappedValue: Int { 0 }
}

struct S {
  @A var x = 7  // error: 'A' cannot be constructed because
                //        it has no accessible initializers
}

If we add a generic type parameter to A, in Swift 5.3 we get two errors:

@propertyWrapper enum A<T> {
  var wrappedValue: Int { 0 }
}

struct S {
  @A var x = 7  // error: 'A<T>' cannot be constructed because
                //        it has no accessible initializers
                // error: Generic parameter 'T' could not be inferred
}

With the development snapshot 2021-01-19, however, the build process fails with the following (full text attached):

Assertion failed: (0 && "Bad base type"), function getContextSubstitutions, file /Users/buildnode/jenkins/workspace/oss-swift-package-macos/swift/lib/AST/Type.cpp, line 4063.
@hborla
Copy link
Member

hborla commented Apr 2, 2021

This should be fixed by #36611

@xAlien95
Copy link
Contributor Author

xAlien95 commented Apr 3, 2021

Thank you! I will mark this as resolved as soon as the next development snapshot is available.

@xAlien95
Copy link
Contributor Author

The fix is available in the 2021-04-10 development snapshot. Thank you, @hborla!

@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

2 participants