Commit Graph

20 Commits

Author SHA1 Message Date
HassanElDesouky
e5c42e4191 [Localization] Add .gitkeep in diagnostics folder 2020-09-03 16:33:23 -07:00
HassanElDesouky
354440402f [Localization] Create swift-def-to-yaml-converter tool 2020-09-03 16:33:23 -07:00
Rintaro Ishizaki
c48a676a1c Merge pull request #31679 from Jumhyn/implicit-member-chains-different-types
[SE-0287] [Sema] Implementation for implicit member chains
2020-08-28 10:47:53 -07:00
Luciano Almeida
4b921c3487 [Sema] Improve diagnostics for key path root type inferred as option accessing wrapped member 2020-08-27 20:07:18 -03:00
Frederick Kellison-Linn
aade4aa74b [Localization] Add new diagnostics to localization file 2020-08-26 22:42:29 -04:00
Suyash Srijan
6e6de518eb [Sema] Improve diagnostics for use of self access kind modifier on accessors inside classes (#33602) 2020-08-25 20:02:52 +01:00
HassanElDesouky
b482de01c0 [Localization] Mirror the messages' changes in .def files 2020-08-18 09:01:42 +02:00
HassanElDesouky
5f74fe31c6 [Localization] Modify messages' format in yaml 2020-08-13 22:36:04 +02:00
Robert Widmann
3a3f92a2f7 Implement Richer Diagnostics for Cross-File Synthesis Failures
Mention the type, the requirement, and the extension in the error that
follows. In editor mode, try to insert stubs for the missing requirement
as well so the user isn't just left with a pile of unactionable errors.
2020-08-11 15:30:23 -07:00
Luciano Almeida
d62e9ddd9e [Diagnostics] Minor adjustments on MissingMember tuple base and yaml message 2020-08-10 21:06:15 -03:00
Luciano Almeida
038eae48f8 Adding SR-13359 diagnostics to localization yaml files and minor comment 2020-08-10 08:40:04 -03:00
Nathan Hawes
38e2bd9c89 [Diagnostics] Demote availability errors to warning for decls in ObjC keypaths to prevent source breakage.
The change to resolve ObjC #keyPath expression components caused some source
breakage as they are now being checked for availability issues. This change
updates availability checking to demote error diagnostics to warnings
within #keyPath expressions. There were cases in the source compat suite where
unavailble properites were used in #keyPath expressions, but they caused no
issues at runtime because the properties' ObjC runtime name was still correct
(e.g. the same as its renamed-to property in Swift).
2020-08-06 10:29:11 -07:00
Pavel Yaskevich
d2cb1cac4f [Diagnostics] NFC: Adjust en.yaml to mirror diagnostics in .def files 2020-08-05 12:13:15 -07:00
Suyash Srijan
d3b5996b05 [Sema] Diagnose explicit access to a lazy variable's underlying storage (#33144) 2020-07-28 19:12:53 +01:00
Suyash Srijan
7ee6319cdc [Parse] [Sema] Update confusables diagnostic to mention the character names as well (#33105)
* [Parser] Update 'Confusables.def' file to include confusable and base character names

* [Parser] Add a new utility method to return the names of the confusable and base characters for a given confusable codepoint

* [Parser] Update diagnostic for confusable character during lexing to mention confusable and base character names

* [Sema] If there is just a single confusable character, emit a tailored diagnostic that also mentions the character names

* [Diagnostics] Add new diagnostic messages to the localization file

* [Test] Update confusables test

* [Utils] Update unicode confusables txt file and update script to regenerate confusables def file

* [Parse] Regenerate 'Confusables.def' using updated script

* [Utils] Adjust generate_confusables script based on review feedback

Fix a mistake with name mapping. Updated header comment. Fix a couple of linting issues.

* [Parse] Regenerate 'Confusables.def' file once again after script changes

* [Parse] Add the newline after end of 'getConfusableAndBaseCodepointNames' method

* [Test] Update diagnostic message in 'Syntax/Parser/diags.swift'
2020-07-27 23:15:31 +01:00
Suyash Srijan
cc49c6105c [Diagnostics] Update diagnostic message for invalid overrides (#33097)
* [Diagnostics] Update 'does not override' diagnostic message to include protocol context as well

* [Sema] Check whether the override context is a class or a protocol for diagnostic purposes

* [Test] Update tests with new diagnostic message for overrides in protocol context

* [Sema] Adjust diagnostic for overrides in structs and enums to use the existing 'override_nonclass_decl' diagnostic
2020-07-27 15:15:28 +01:00
Brent Royal-Gordon
57469a6472 Allow shadowing of unavailable members
This change permits a subclass to redeclare an unavailable member from a superclass. For instance, suppose you write this code (or, more likely, a version where `Base` is an ObjC class):

```swift
class Base {
  @available(*, unavailable) init() {}
}

class Derived: Base {
  /* override */ init() {}
}
```

Previously, Swift would reject `Derived.init()` without the `override` keyword, telling you that you should add it, but it would also reject it *with* the `override` keyword, telling you that you can't override something that's unavailable. This PR makes Swift accept it without the `override` keyword; declaring it with the keyword is still forbidden.

Fixes rdar://65702529.
2020-07-22 15:49:01 -07:00
Luciano Almeida
ecb70d2ad3 [Diagnostics] Adding optional note specific to keypath application base diagnostics 2020-07-15 08:53:31 -03:00
Suyash Srijan
0aabee59d6 [Typechecker] Emit specialized diagnostic notes on automatic synthesis failure to Comparable (#32797) 2020-07-14 22:03:08 +01:00
Pavel Yaskevich
8461047ae6 [Build] Move diagnostic translations from include to dedicated localization/ directory 2020-07-13 22:23:52 -07:00