Commit Graph

5 Commits

Author SHA1 Message Date
Hamish Knight
87f9820c85 [AST] Visit TypeValueExpr's TypeRepr in ASTWalker
Ensure that we walk the TypeRepr to ensure that both cursor info and
indexing pick up on the reference to the generic parameter.

rdar://145509737
2025-07-16 21:19:15 +01:00
Manu
02b5fa2c8e Fix some typos in the codebase 2023-08-31 18:50:10 -03:00
Keith Smiley
f5fbee2f26 Fix indexing constructors with generic parameters (#65597)
Previously in the case of a constructor like `A<Int>(value: 1)`
`Fn->getLoc()` returned the location of `>(value: 1)` while the actual
location we're looking for is correctly the start of `A<Int>(value: 1)`.
This adjusts the location we're looking up to use the start location of
the constructor instead.

Fixes: https://github.com/apple/swift/issues/54532
2023-05-05 15:20:07 -07:00
Josh Soref
3c8ec81efb Spelling index (#42543)
* spelling: different

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: implicit

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: overridden

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: parameter

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: treat

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: unknown

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
2022-04-25 12:59:12 -07:00
Alex Hoppen
053a4d7ec8 [Index] Index generic parameters used inside extensions
Extensions redeclare all generic parameters of their extended type to add their additional restrictions. There are two issues with this model for indexing:
 - The generic paramter declarations of the extension are implicit so we wouldn't report them in the index. Any usage of the generic param in the extension references this implicit declaration so we don't include it in the index either.
 - The implicit re-declarations have their own USRs so any usage of a generic parameter inside an extension would use a different USR than declaration of the param in the extended type.

To fix these issues, we replace the reference to the implicit generic parameter defined in the extension by a reference to the generic paramter defined in the extended type.
2021-04-15 08:55:47 +02:00