diff --git a/go/ql/test/library-tests/semmle/go/aliases/DataflowFields/embedding.go b/go/ql/test/library-tests/semmle/go/aliases/DataflowFields/embedding.go index dd947f788441..fd255bddb460 100644 --- a/go/ql/test/library-tests/semmle/go/aliases/DataflowFields/embedding.go +++ b/go/ql/test/library-tests/semmle/go/aliases/DataflowFields/embedding.go @@ -8,7 +8,10 @@ import ( // Tests that dataflow behaves as expected when loads and stores from a field traverse embeddings that use different type names. // pkg2.IntStruct is an alias for pkg1.IntStruct -// Note trickery with packages is necessary so that Go will assign the fields the same name as well as the same type. +// Note referring to symbols in different packages is necessary so that Go will assign the fields the same name as well as the same type-- +// for example, if we defined two aliases here named 'IntStruct1' and 'IntStruct2' and embedded them into two types, +// the types would be non-identical due to having a field implicitly named IntStruct1 and IntStruct2 respectively, +// even though syntactically it could be addressed without mentioning the field name. type EmbedsPkg1IntStruct = struct{ pkg1.IntStruct } type EmbedsPkg2IntStruct = struct{ pkg2.IntStruct } diff --git a/go/ql/test/library-tests/semmle/go/aliases/DataflowFields/go.mod b/go/ql/test/library-tests/semmle/go/aliases/DataflowFields/go.mod index 73c535bcc34b..5fb81a66e38e 100644 --- a/go/ql/test/library-tests/semmle/go/aliases/DataflowFields/go.mod +++ b/go/ql/test/library-tests/semmle/go/aliases/DataflowFields/go.mod @@ -1,3 +1,3 @@ module test.com/basename -go 1.22.5 +go 1.23.1 diff --git a/go/ql/test/library-tests/semmle/go/aliases/InterfaceImpls/test.go b/go/ql/test/library-tests/semmle/go/aliases/InterfaceImpls/test.go index 8baa8e4ebba7..0d09449514d7 100644 --- a/go/ql/test/library-tests/semmle/go/aliases/InterfaceImpls/test.go +++ b/go/ql/test/library-tests/semmle/go/aliases/InterfaceImpls/test.go @@ -1,7 +1,9 @@ package intfs // Tests that dataflow and interface implementation behave as expected when an interface -// is implemented using a non-equal but identical type, i.e. an equal type after alias resolution. +// is implemented using an identical type (in the structural sense defined by the go spec) +// where the two types differ at surface level, i.e. aliases must be followed to determine +// that they are identical. type IntAlias = int