Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Go: add tests regarding type aliasing #17369

Merged
merged 7 commits into from
Sep 5, 2024

Conversation

smowton
Copy link
Contributor

@smowton smowton commented Sep 3, 2024

Targeted at rc/3.15 because we intend to get Go 1.23 into this branch, and the Go 1.23 compiler exposes us to type aliasing considerably more than 1.22.

Suggested additional tests:

  • Dataflow via field/pointer aliasing (sketch: type T1 = struct { x int }; type T2 = struct { x IntAlias } ... var t1 T1 ... t1.x = source() ... f(&t1) ... func f(t2 *T2) { sink(t2.x) })
  • Dataflow via field/pointer aliasing including embedding -- similar to the above, but exercise the case where embedding is done via type aliasing -- so e.g. struct { Embedded1 } vs struct { Embedded2 }, where type Embedded2 = Embedded1. This needed particularly handling at df13f89
  • Dataflow across interface implementations, an extension of the interface-implements test already committed here to ensure the dataflow lib's idea of interface implementation matches Type.implements.

Update: those additional tests are added in #17400

@smowton smowton requested a review from a team as a code owner September 3, 2024 16:58
@github-actions github-actions bot added the Go label Sep 3, 2024
@mbg mbg merged commit 1e32e84 into github:rc/3.15 Sep 5, 2024
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants