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-15926] Generic type put into wrong position #58187

Open
davezarzycki opened this issue Mar 1, 2022 · 0 comments
Open

[SR-15926] Generic type put into wrong position #58187

davezarzycki opened this issue Mar 1, 2022 · 0 comments
Labels
bug A deviation from expected or documented behavior. Also: expected but undesirable behavior.

Comments

@davezarzycki
Copy link
Contributor

Previous ID SR-15926
Radar None
Original Reporter @davezarzycki
Type Bug
Additional Detail from JIRA
Votes 0
Component/s
Labels Bug
Assignee None
Priority Medium

md5: e36e5f9935917b445f49367065ced788

Issue Description:

The bottom two lines should be essentially the same to Sema but aren't in practice. If you look closely at the diagnostics output and debug constraints of the former, then you'll see that "Float" is inferred into the wrong position, which seems very wrong. Specifically:

unresolved_specialize_expr type='MyType<Float, $T2>.Type' location=/tmp/g.swift:10:53 range=[/tmp/g.swift:10:38 - line:10:59]

If the test looks familiar it is because it is derived from the bottom of test/decl/typealias/protocol.swift:

struct MyType<TyA, TyB> {
  var a : TyA, b : TyB
}
class GenericClass<T> {
  typealias TA<U> = MyType<T, U>
}
let _: GenericClass<Int>.TA<Float> = GenericClass.TA<Float>(a: 1, b: 4.0)
let _: GenericClass<Int>.TA<Float> = GenericClass<_>.TA<Float>(a: 1, b: 4.0)
@swift-ci swift-ci transferred this issue from apple/swift-issues Apr 25, 2022
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

1 participant