Commit Graph

3 Commits

Author SHA1 Message Date
Jordan Rose
4b87bd93f9 Tweak DiagnosticEngine's 'aka' logic to only kick in for typealiases. (#9010)
Previously we had more ad hoc logic that tried to decide if it was
worth desugaring a type based on its structure. Now we instead look
for a typealias that might actually benefit from desugaring, and if
we don't find one we won't show the 'aka' note.
2017-04-25 19:37:22 -07:00
Jordan Rose
9489f10ce1 Use Swift-3-style access checking to downgrade errors to warnings.
...instead of just ignoring the errors in certain cases, in service of
source compatibility.

Swift 3.0 wasn't nearly as strict as checking access control for types
because it didn't look at the TypeRepr at all (except to highlight a
particular part of the type in diagnostics). It also looked through
typealiases in certain cases. Approximate this behavior by running the
access checking logic for Types (rather than TypeReprs), and downgrade
access violation errors to warnings when the checks disagree.

Part of rdar://problem/29855782.
2017-01-13 14:34:50 -08:00
Jordan Rose
6dbcfc9f49 Don't check access for compound TypeReprs in Swift 3 mode.
Swift 3 just looked at what types we ended up with, not what types
we had to traverse to get there. Preserve this behavior for source
compatibility. (We ought to be able to warn, at least, but for now
getting source compatibility back is most important.)

Part of rdar://problem/29782505.
2017-01-03 13:14:23 -08:00