Skip to content

[Diagnostics] Fix missing any warnings for type aliases. #41481

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

Merged
merged 1 commit into from
Feb 21, 2022

Conversation

hborla
Copy link
Member

@hborla hborla commented Feb 19, 2022

Only warn when using a type alias if the underlying type is directly a constraint type, e.g.

protocol P {
  associatedtype A
}

typealias Constraint = P

let x: Constraint // warning for missing 'any' on 'Constraint'

Also check the underlying type at the declaration of a type alias for missing 'any' if the underlying type is not directly a constraint type, e.g.

protocol P {
  associatedtype A
}

typealias Function = (P) -> Void // warning for missing 'any' on 'P'

Resolves: rdar://88980470

Only warn when using a type alias if the underlying type is directly
a constraint type. Also check the underlying type for missing 'any'
if the underlying type is not directly a constraint type.
@hborla hborla requested a review from slavapestov February 19, 2022 23:26
@hborla
Copy link
Member Author

hborla commented Feb 19, 2022

@swift-ci please smoke test

@hborla hborla merged commit 9297ba1 into swiftlang:main Feb 21, 2022
@hborla hborla deleted the missing-any-diagnostics branch February 21, 2022 17:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant