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-11531] strange error: 'Test<E>' requires the types 'E' and 'E.Magnitude' be equivalent #53932

Closed
mayoff opened this issue Sep 26, 2019 · 3 comments
Assignees
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.

Comments

@mayoff
Copy link

mayoff commented Sep 26, 2019

Previous ID SR-11531
Radar rdar://problem/55758436
Original Reporter @mayoff
Type Bug
Status Resolved
Resolution Done
Environment

swift-DEVELOPMENT-SNAPSHOT-2019-09-25-a.xctoolchain
Xcode-11.1 GM Seed
macOS 10.14.6 (18G95)

Additional Detail from JIRA
Votes 1
Component/s
Labels Bug
Assignee @mayoff
Priority Medium

md5: e3f1abff2287b50fad2316963191cae8

relates to:

  • SR-11532 swiftc crash with Magnitude constraints on both type and init

Issue Description:

Swift emits an error for the following:

public struct Test<E: BinaryInteger> where E.Magnitude == E {
    var x: Int
    init<F: BinaryInteger>(_: F) where F.Magnitude == E {
        x = 0 // error emitted on this line
    }
}

The error given is: 'Test<E>' requires the types 'E' and 'E.Magnitude' be equivalent

@mayoff
Copy link
Author

mayoff commented Sep 26, 2019

Perhaps the same bug.

@belkadan
Copy link
Contributor

@swift-ci create

@xedin
Copy link
Member

xedin commented Mar 30, 2021

I'm not exactly sure when this got fixed but code from the description no longer fails to type-check on main. @mayoff Please use the latest snapshot of main branch to verify and close.

@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.
Projects
None yet
Development

No branches or pull requests

3 participants