Commit Graph

15 Commits

Author SHA1 Message Date
Anthony Latsis
5e41794680 AST: Quote attributes more consistently in DiagnosticsSema.def 2025-04-23 19:18:08 +01:00
Doug Gregor
e88f8995e1 [Diagnostics] Eliminate educational notes in favor of diagnostic groups
We've been converging the implementations of educational notes and
diagnostic groups, where both provide category information in
diagnostics (e.g., `[#StrictMemorySafety]`) and corresponding
short-form documentation files. The diagnostic group model is more
useful in a few ways:

* It provides warnings-as-errors control for warnings in the group
* It is easier to associate a diagnostic with a group with
GROUPED_ERROR/GROUPED_WARNING than it is to have a separate diagnostic
ID -> mapping.
* It is easier to see our progress on diagnostic-group coverage
* It provides an easy name to use for diagnostic purposes.

Collapse the educational-notes infrastructure into diagnostic groups,
migrating all of the existing educational notes into new groups.
Simplify the code paths that dealt with multiple educational notes to
have a single, possibly-missing "category documentation URL", which is
how we're treating this.
2025-03-29 15:40:35 -07:00
Anthony Latsis
85fae6b9ff Gardening: Migrate test suite to GH issues: attr 2022-08-11 18:00:04 +03:00
Hamish Knight
fe7c1f4b9b Refactor callable lookup
Move off `Type` based requests and onto `Decl`
based requests, utilizing name lookup's
`extractDirectlyReferencedNominalTypes` utility.
This allows us to better cache the results, and
avoids the need to guard against type variable
inputs when deciding whether or not to cache.
2022-07-25 22:03:55 +01:00
Holly Borla
12459cff80 [Diagnostics] Print 'any' in diagnostic arguments. 2022-03-05 14:26:45 -08:00
Owen Voorhees
77aa5642c3 [Diagnostics] Expand test coverage of existing edu notes 2020-04-09 18:18:25 -07:00
Luciano Almeida
6ca7e383a9 [tests] Add more test cases for SR-12019 dynamic callable 2020-03-08 22:56:26 -03:00
Luciano Almeida
c1e517a798 [tests] Adding tests for SR-12019 2020-03-07 16:52:47 -03:00
Suyash Srijan
543d649278 [Diagnostics] Warn when the result of a Void-returning function is ignored (by assigning into '_') (#29576) 2020-02-04 20:19:37 +00:00
Pavel Yaskevich
328143ad4d [ConstraintSystem] Align @dynamicCallable argument locators with regular calls
Having the same locators for `@dynamicCallable` and the regular calls
make it much easier to produce diagnostics.
2019-12-06 16:43:18 -08:00
David Moore
6a0d540949 Sema: Improve @dynamicCallable Diagnostics for Incorrect Parameter Types 2019-11-26 15:02:02 -05:00
Azoy
f48df2dbeb Add test case for SR-10753 2019-07-05 20:46:27 -04:00
Azoy
d0c727dd36 Restructure implicit AST for @dynamicCallable
add tests

dont assume dict type

dont assume member ref ast

formatting

more formatting

Update getTypeWitnessByName
2019-07-05 20:46:12 -04:00
Dan Zheng
eebccb7a09 Fix @dynamicMemberLookup for protocol/archetype types. (#20516)
- Enable `subscript(dynamicMember:)` as a requirement for
  `@dynamicMemberLookup` protocols.
- Add tests.
- Minor `@dynamicCallable`-related gardening.

Resolves SR-8077.
2018-11-13 18:13:33 -05:00
Dan Zheng
2a4e1b83fd Implement @dynamicCallable. (#20305)
* Implement dynamically callable types (`@dynamicCallable`).

- Implement dynamically callable types as proposed in SE-0216.
  - Dynamic calls are resolved based on call-site syntax.
  - Use the `withArguments:` method if it's defined and there are no
    keyword arguments.
  - Otherwise, use the `withKeywordArguments:` method.
- Support multiple `dynamicallyCall` methods.
  - This enables two scenarios:
    - Overloaded `dynamicallyCall` methods on a single
      `@dynamicCallable` type.
    - Multiple `dynamicallyCall` methods from a `@dynamicCallable`
      superclass or from `@dynamicCallable` protocols.
  - Add `DynamicCallableApplicableFunction` constraint. This, used with
    an overload set, is necessary to support multiple `dynamicallyCall`
    methods.
2018-11-09 09:49:14 -08:00