File: cursor_info_param.swift

package info (click to toggle)
swiftlang 6.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 2,519,992 kB
  • sloc: cpp: 9,107,863; ansic: 2,040,022; asm: 1,135,751; python: 296,500; objc: 82,456; f90: 60,502; lisp: 34,951; pascal: 19,946; sh: 18,133; perl: 7,482; ml: 4,937; javascript: 4,117; makefile: 3,840; awk: 3,535; xml: 914; fortran: 619; cs: 573; ruby: 573
file content (43 lines) | stat: -rw-r--r-- 1,977 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
func simpleParams(a: Int, b theB: Int) {}

struct AccessorTest {
  subscript(a: Int, b theB: Int) -> Int { return a }
  var prop: Int {
    get { return 0 }
    set(v) {}
  }
}

#sourceLocation(file: "custom.swuft", line: 2000)
func customSourceLocation(a: Int) {}
#sourceLocation()

// RUN: %sourcekitd-test -req=cursor -pos=1:19 %s -- %s | %FileCheck -check-prefix=CHECK-FUNC-A %s
// CHECK-FUNC-A: s:17cursor_info_param12simpleParams1a1bySi_SitFACL_Sivp
// CHECK-FUNC-A: PARENT OFFSET: 5

// RUN: %sourcekitd-test -req=cursor -pos=1:27 %s -- %s | %FileCheck -check-prefix=CHECK-FUNC-B %s
// CHECK-FUNC-B: s:17cursor_info_param12simpleParams1a1bySi_SitF{{$}}

// RUN: %sourcekitd-test -req=cursor -pos=1:29 %s -- %s | %FileCheck -check-prefix=CHECK-FUNC-THEB %s
// CHECK-FUNC-THEB: s:17cursor_info_param12simpleParams1a1bySi_SitF4theBL_Sivp
// CHECK-FUNC-THEB-NOT: PARENT OFFSET

// RUN: %sourcekitd-test -req=cursor -pos=4:13 %s -- %s | %FileCheck -check-prefix=CHECK-SUBSCRIPT-A %s
// CHECK-SUBSCRIPT-A: s:17cursor_info_param12AccessorTestV_1bS2i_Sitcip1aL_Sivp
// CHECK-SUBSCRIPT-A: PARENT OFFSET: 67

// RUN: %sourcekitd-test -req=cursor -pos=4:21 %s -- %s | %FileCheck -check-prefix=CHECK-SUBSCRIPT-B %s
// CHECK-SUBSCRIPT-B: s:17cursor_info_param12AccessorTestV

// RUN: %sourcekitd-test -req=cursor -pos=4:23 %s -- %s | %FileCheck -check-prefix=CHECK-SUBSCRIPT-THEB %s
// CHECK-SUBSCRIPT-THEB: s:17cursor_info_param12AccessorTestV_1bS2i_Sitcip4theBL_Sivp
// CHECK-SUBSCRIPT-THEB-NOT: PARENT OFFSET

// RUN: %sourcekitd-test -req=cursor -pos=7:9 %s -- %s | %FileCheck -check-prefix=CHECK-SETTER-V %s
// CHECK-SETTER-V: s:17cursor_info_param12AccessorTestV4propSivs1vL_Sivp
// CHECK-SETTER-V: PARENT OFFSET: 161

// RUN: %sourcekitd-test -req=cursor -pos=12:27 %s -- %s | %FileCheck -check-prefix=CHECK-CUSTOM-SOURCELOCATION %s
// CHECK-CUSTOM-SOURCELOCATION: s:17cursor_info_param20customSourceLocation1aySi_tFACL_Sivp
// CHECK-CUSTOM-SOURCELOCATION: PARENT OFFSET: 233