File tree Expand file tree Collapse file tree 3 files changed +8
-3
lines changed
go/ql/test/library-tests/semmle/go/aliases Expand file tree Collapse file tree 3 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,10 @@ import (
88// Tests that dataflow behaves as expected when loads and stores from a field traverse embeddings that use different type names.
99
1010// pkg2.IntStruct is an alias for pkg1.IntStruct
11- // Note trickery with packages is necessary so that Go will assign the fields the same name as well as the same type.
11+ // 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--
12+ // for example, if we defined two aliases here named 'IntStruct1' and 'IntStruct2' and embedded them into two types,
13+ // the types would be non-identical due to having a field implicitly named IntStruct1 and IntStruct2 respectively,
14+ // even though syntactically it could be addressed without mentioning the field name.
1215
1316type EmbedsPkg1IntStruct = struct { pkg1.IntStruct }
1417type EmbedsPkg2IntStruct = struct { pkg2.IntStruct }
Original file line number Diff line number Diff line change 11module test.com/basename
22
3- go 1.22.5
3+ go 1.23.1
Original file line number Diff line number Diff line change 11package intfs
22
33// Tests that dataflow and interface implementation behave as expected when an interface
4- // is implemented using a non-equal but identical type, i.e. an equal type after alias resolution.
4+ // is implemented using an identical type (in the structural sense defined by the go spec)
5+ // where the two types differ at surface level, i.e. aliases must be followed to determine
6+ // that they are identical.
57
68type IntAlias = int
79
You can’t perform that action at this time.
0 commit comments