-
Notifications
You must be signed in to change notification settings - Fork 10.5k
tests: Add a missing typealias
test case and verifications for a few FIXMEs
#60972
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
Conversation
@slavapestov ping |
// This occurs because the constraint solver does the wrong thing with an | ||
// UnresolvedSpecializeExpr applied to a generic typealias. | ||
// | ||
// In the other cases, we manage to fold the UnresolvedSpecializeExpr in the | ||
// precheckExpression() phase, which handles generic typealiases correctly. | ||
|
||
let _ = GenericClass.TA<Float>(a: 4.0, b: 1) // FIXME |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think these might still be wrong? Can you verify that it produces the correct underlying type vs when the alias appears in type context?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh, good catch, you’re right! What an odd bug though; I will bring back the FIXMEs and add a verification of this error.
struct S<X, Y> {
var x: X, y: Y
}
class C<T> {
typealias TA<U> = S<T, U>
}
let s1 = C.TA<Float>(x: 4.0, y: 1)
let s2: S<Double, Float> = s1 // cannot assign value of type 'S<Float, Int>' to type 'S<Double, Float>'
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the bug is because SpecializeExpr doesn't handle type alias types correctly. It just desugars the underlying type.
e3f1ec6
to
7690f31
Compare
typealias
test case and remove a few stale FIXMEs thereintypealias
test case and verifications for a few FIXMEs therein
typealias
test case and verifications for a few FIXMEs thereintypealias
test case and verifications for a few FIXMEs
7690f31
to
5d61a5d
Compare
typealias
test case and verifications for a few FIXMEstypealias
test case and verifications for a few FIXMEs
@slavapestov ping |
@swift-ci please smoke test |
No description provided.