mirror of
https://github.com/github/codeql.git
synced 2026-05-04 21:25:44 +02:00
Autoformat
This commit is contained in:
@@ -1,13 +1,13 @@
|
||||
callTargets
|
||||
| test.go:38:2:38:24 | call to ImplementMe | test.go:12:1:12:72 | function declaration | ImplementMe |
|
||||
| test.go:38:2:38:24 | call to ImplementMe | test.go:17:1:17:67 | function declaration | ImplementMe |
|
||||
| test.go:38:2:38:24 | call to ImplementMe | test.go:23:1:23:54 | function declaration | ImplementMe |
|
||||
| test.go:38:2:38:24 | call to ImplementMe | test.go:29:1:29:61 | function declaration | ImplementMe |
|
||||
| test.go:38:2:38:24 | call to ImplementMe | test.go:35:1:35:74 | function declaration | ImplementMe |
|
||||
| test.go:41:2:41:24 | call to ImplementMe | test.go:12:1:12:69 | function declaration | ImplementMe |
|
||||
| test.go:41:2:41:24 | call to ImplementMe | test.go:17:1:17:64 | function declaration | ImplementMe |
|
||||
| test.go:41:2:41:24 | call to ImplementMe | test.go:24:1:24:53 | function declaration | ImplementMe |
|
||||
| test.go:41:2:41:24 | call to ImplementMe | test.go:31:1:31:59 | function declaration | ImplementMe |
|
||||
| test.go:41:2:41:24 | call to ImplementMe | test.go:38:1:38:71 | function declaration | ImplementMe |
|
||||
#select
|
||||
| file://:0:0:0:0 | basic interface type | file://:0:0:0:0 | basic interface type |
|
||||
| file://:0:0:0:0 | basic interface type | test.go:10:6:10:10 | Impl1 |
|
||||
| file://:0:0:0:0 | basic interface type | test.go:15:6:15:10 | Impl2 |
|
||||
| file://:0:0:0:0 | basic interface type | test.go:20:6:20:10 | Impl3 |
|
||||
| file://:0:0:0:0 | basic interface type | test.go:26:6:26:10 | Impl4 |
|
||||
| file://:0:0:0:0 | basic interface type | test.go:32:6:32:10 | Impl5 |
|
||||
| file://:0:0:0:0 | basic interface type | test.go:27:6:27:10 | Impl4 |
|
||||
| file://:0:0:0:0 | basic interface type | test.go:34:6:34:10 | Impl5 |
|
||||
|
||||
@@ -3,36 +3,39 @@ package intfs
|
||||
type IntAlias = int
|
||||
|
||||
type Target = interface {
|
||||
ImplementMe(callable func (struct { x IntAlias }))
|
||||
ImplementMe(callable func(struct{ x IntAlias }))
|
||||
}
|
||||
|
||||
// Simple direct implementation
|
||||
type Impl1 struct {}
|
||||
type Impl1 struct{}
|
||||
|
||||
func (recv Impl1) ImplementMe(callable func (struct { x IntAlias })) { }
|
||||
func (recv Impl1) ImplementMe(callable func(struct{ x IntAlias })) {}
|
||||
|
||||
// Implementation via unalising
|
||||
type Impl2 struct {}
|
||||
type Impl2 struct{}
|
||||
|
||||
func (recv Impl2) ImplementMe(callable func (struct { x int })) { }
|
||||
func (recv Impl2) ImplementMe(callable func(struct{ x int })) {}
|
||||
|
||||
// Implementation via top-level aliasing
|
||||
type Impl3 struct {}
|
||||
type Impl3 struct{}
|
||||
|
||||
type Impl3Alias = func (struct { x IntAlias })
|
||||
func (recv Impl3) ImplementMe(callable Impl3Alias) { }
|
||||
type Impl3Alias = func(struct{ x IntAlias })
|
||||
|
||||
func (recv Impl3) ImplementMe(callable Impl3Alias) {}
|
||||
|
||||
// Implementation via aliasing the struct
|
||||
type Impl4 struct {}
|
||||
type Impl4 struct{}
|
||||
|
||||
type Impl4Alias = struct { x IntAlias }
|
||||
func (recv Impl4) ImplementMe(callable func (Impl4Alias)) { }
|
||||
type Impl4Alias = struct{ x IntAlias }
|
||||
|
||||
func (recv Impl4) ImplementMe(callable func(Impl4Alias)) {}
|
||||
|
||||
// Implementation via aliasing the struct member
|
||||
type Impl5 struct {}
|
||||
type Impl5 struct{}
|
||||
|
||||
type Impl5Alias = IntAlias
|
||||
func (recv Impl5) ImplementMe(callable func (struct { x Impl5Alias })) { }
|
||||
type Impl5Alias = IntAlias
|
||||
|
||||
func (recv Impl5) ImplementMe(callable func(struct{ x Impl5Alias })) {}
|
||||
|
||||
func Caller(target Target) {
|
||||
target.ImplementMe(nil)
|
||||
|
||||
@@ -5,6 +5,7 @@ query predicate callTargets(DataFlow::CallNode cn, FuncDef target, string target
|
||||
}
|
||||
|
||||
from InterfaceType i, Type impl
|
||||
where i.hasMethod("ImplementMe", _)
|
||||
and impl.implements(i)
|
||||
where
|
||||
i.hasMethod("ImplementMe", _) and
|
||||
impl.implements(i)
|
||||
select i, impl
|
||||
|
||||
Reference in New Issue
Block a user