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 11callTargets
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 |
78#select
89| file://:0:0:0:0 | basic interface type | file://:0:0:0:0 | basic interface type |
910| file://:0:0:0:0 | basic interface type | test.go:10:6:10:10 | Impl1 |
1011| file://:0:0:0:0 | basic interface type | test.go:15:6:15:10 | Impl2 |
1112| file://:0:0:0:0 | basic interface type | test.go:20:6:20:10 | Impl3 |
1213| file://:0:0:0:0 | basic interface type | test.go:27:6:27:10 | Impl4 |
1314| 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{}
1111
1212func (recv Impl1 ) ImplementMe (callable func (struct { x IntAlias })) {}
1313
14- // Implementation via unalising
14+ // Implementation via unaliasing
1515type Impl2 struct {}
1616
1717func (recv Impl2 ) ImplementMe (callable func (struct { x int })) {}
@@ -37,6 +37,13 @@ type Impl5Alias = IntAlias
3737
3838func (recv Impl5 ) ImplementMe (callable func (struct { x Impl5Alias })) {}
3939
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+
4047func Caller (target Target ) {
4148 target .ImplementMe (nil )
4249}
You can’t perform that action at this time.
0 commit comments