Skip to content

[Index] Array literal extension does not relate Array type #84423

@ileitch

Description

@ileitch

Description

In main, an extension on Array using the literal syntax of [String] does not provide the implicit relation to Array.

Reproduction

extension [String] {}

// 1:12 | struct/Swift | String | s:SS | Ref | rel: 0
extension Array where Element == String {}

// 1:11 | struct/Swift | Array | s:Sa | Ref | rel: 0
// 1:23 | type-alias/generic-type-param/Swift | Element | s:Sa7Elementxmfp | Ref | rel: 0
// 1:34 | struct/Swift | String | s:SS | Ref | rel: 0

Expected behavior

The swift-ide-test output for both extensions should be the same.

Environment

This is a bug in main. Swift 6.2 is not affected.

Additional information

No response

Metadata

Metadata

Assignees

Labels

bugA deviation from expected or documented behavior. Also: expected but undesirable behavior.compilerThe Swift compiler itselfindexingArea → source tooling: AST indexing

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions