File tree Expand file tree Collapse file tree 2 files changed +15
-6
lines changed
go/ql/test/library-tests/semmle/go/aliases/InterfaceImpls Expand file tree Collapse file tree 2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change 1
1
callTargets
2
- | test.go:41:2:41:24 | call to ImplementMe | test.go:12:1:12:69 | function declaration | ImplementMe |
3
- | test.go:41:2:41:24 | call to ImplementMe | test.go:17:1:17:64 | function declaration | ImplementMe |
4
- | test.go:41:2:41:24 | call to ImplementMe | test.go:24:1:24:53 | function declaration | ImplementMe |
5
- | test.go:41:2:41:24 | call to ImplementMe | test.go:31:1:31:59 | function declaration | ImplementMe |
6
- | test.go:41:2:41:24 | call to ImplementMe | test.go:38:1:38:71 | function declaration | ImplementMe |
2
+ | test.go:48:2:48:24 | call to ImplementMe | test.go:12:1:12:69 | function declaration | ImplementMe |
3
+ | test.go:48:2:48:24 | call to ImplementMe | test.go:17:1:17:64 | function declaration | ImplementMe |
4
+ | test.go:48:2:48:24 | call to ImplementMe | test.go:24:1:24:53 | function declaration | ImplementMe |
5
+ | test.go:48:2:48:24 | call to ImplementMe | test.go:31:1:31:59 | function declaration | ImplementMe |
6
+ | test.go:48:2:48:24 | call to ImplementMe | test.go:38:1:38:71 | function declaration | ImplementMe |
7
+ | test.go:48:2:48:24 | call to ImplementMe | test.go:45:1:45:69 | function declaration | ImplementMe |
7
8
#select
8
9
| file://:0:0:0:0 | basic interface type | file://:0:0:0:0 | basic interface type |
9
10
| file://:0:0:0:0 | basic interface type | test.go:10:6:10:10 | Impl1 |
10
11
| file://:0:0:0:0 | basic interface type | test.go:15:6:15:10 | Impl2 |
11
12
| file://:0:0:0:0 | basic interface type | test.go:20:6:20:10 | Impl3 |
12
13
| file://:0:0:0:0 | basic interface type | test.go:27:6:27:10 | Impl4 |
13
14
| file://:0:0:0:0 | basic interface type | test.go:34:6:34:10 | Impl5 |
15
+ | file://:0:0:0:0 | basic interface type | test.go:41:6:41:10 | Impl6 |
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ type Impl1 struct{}
11
11
12
12
func (recv Impl1 ) ImplementMe (callable func (struct { x IntAlias })) {}
13
13
14
- // Implementation via unalising
14
+ // Implementation via unaliasing
15
15
type Impl2 struct {}
16
16
17
17
func (recv Impl2 ) ImplementMe (callable func (struct { x int })) {}
@@ -37,6 +37,13 @@ type Impl5Alias = IntAlias
37
37
38
38
func (recv Impl5 ) ImplementMe (callable func (struct { x Impl5Alias })) {}
39
39
40
+ // Implementation via defining the method on an alias
41
+ type Impl6 struct {}
42
+
43
+ type Impl6Alias = Impl6
44
+
45
+ func (recv Impl6Alias ) ImplementMe (callable func (struct { x int })) {}
46
+
40
47
func Caller (target Target ) {
41
48
target .ImplementMe (nil )
42
49
}
You can’t perform that action at this time.
0 commit comments