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

Handle newly-introduced types.Alias type #286

Merged
merged 3 commits into from
Oct 10, 2024
Merged

Conversation

yuxincs
Copy link
Contributor

@yuxincs yuxincs commented Oct 8, 2024

Go 1.22 [1] introduces a proper types.Alias type for type aliases. This PR adds handling (by simply unwrapping alias node - effectively restoring previous behavior) for such a type.

Further simplification and refactors will be in future PRs.

Copy link

codecov bot commented Oct 8, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.91%. Comparing base (045b340) to head (9766ed2).
Report is 1 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #286   +/-   ##
=======================================
  Coverage   87.91%   87.91%           
=======================================
  Files          66       66           
  Lines        7935     7935           
=======================================
  Hits         6976     6976           
  Misses        785      785           
  Partials      174      174           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

github-actions bot commented Oct 8, 2024

Golden Test

Warning

❌ NilAway errors reported on stdlib are different.

3211 errors on base branch (main, 045b340)
3211 errors on test branch (adc01a6)

Diffs
+ /opt/hostedtoolcache/go/1.23.2/x64/src/internal/unsafeheader/unsafeheader.go:1:1: INTERNAL ERROR(s):
+ nilaway_assertion_analyzer: nilaway_function_analyzer: analyzing function AppendSeq at /opt/hostedtoolcache/go/1.23.2/x64/src/slices/iter.go:49.1: backpropagation across node (/opt/hostedtoolcache/go/1.23.2/x64/src/slices/iter.go:50:6) of type *ast.AssignStmt failed for reason: unrecognized type of rhs in range statement: iter.Seq[E]
+ /opt/hostedtoolcache/go/1.23.2/x64/src/internal/unsafeheader/unsafeheader.go:1:1: INTERNAL ERROR(s):
+ nilaway_assertion_analyzer: nilaway_function_analyzer: analyzing function ExampleChunk at /opt/hostedtoolcache/go/1.23.2/x64/src/slices/example_test.go:388.1: backpropagation across node (/opt/hostedtoolcache/go/1.23.2/x64/src/slices/example_test.go:405:6) of type *ast.AssignStmt failed for reason: unrecognized type of rhs in range statement: iter.Seq[slices_test.People]
+ analyzing function TestValues at /opt/hostedtoolcache/go/1.23.2/x64/src/slices/iter_test.go:58.1: backpropagation across node (/opt/hostedtoolcache/go/1.23.2/x64/src/slices/iter_test.go:66:7) of type *ast.AssignStmt failed for reason: unrecognized type of rhs in range statement: iter.Seq[int]
+ analyzing function TestChunkRange at /opt/hostedtoolcache/go/1.23.2/x64/src/slices/iter_test.go:275.1: backpropagation across node (/opt/hostedtoolcache/go/1.23.2/x64/src/slices/iter_test.go:278:6) of type *ast.AssignStmt failed for reason: unrecognized type of rhs in range statement: iter.Seq[[]int]
+ /opt/hostedtoolcache/go/1.23.2/x64/src/internal/unsafeheader/unsafeheader.go:1:1: INTERNAL ERROR(s):
+ nilaway_assertion_analyzer: nilaway_function_analyzer: analyzing function ExamplePreorder at /opt/hostedtoolcache/go/1.23.2/x64/src/go/ast/example_test.go:143.1: backpropagation across node (/opt/hostedtoolcache/go/1.23.2/x64/src/go/ast/example_test.go:159:6) of type *ast.AssignStmt failed for reason: unrecognized type of rhs in range statement: iter.Seq[go/ast.Node]
+ analyzing function TestPreorderBreak at /opt/hostedtoolcache/go/1.23.2/x64/src/go/ast/walk_test.go:14.1: backpropagation across node (/opt/hostedtoolcache/go/1.23.2/x64/src/go/ast/walk_test.go:28:6) of type *ast.AssignStmt failed for reason: unrecognized type of rhs in range statement: iter.Seq[go/ast.Node]
+ /opt/hostedtoolcache/go/1.23.2/x64/src/internal/unsafeheader/unsafeheader.go:1:1: INTERNAL ERROR(s):
+ nilaway_assertion_analyzer: nilaway_function_analyzer: analyzing function TestKeys at /opt/hostedtoolcache/go/1.23.2/x64/src/maps/iter_test.go:32.1: backpropagation across node (/opt/hostedtoolcache/go/1.23.2/x64/src/maps/iter_test.go:42:7) of type *ast.AssignStmt failed for reason: unrecognized type of rhs in range statement: iter.Seq[int]
+ analyzing function TestValues at /opt/hostedtoolcache/go/1.23.2/x64/src/maps/iter_test.go:52.1: backpropagation across node (/opt/hostedtoolcache/go/1.23.2/x64/src/maps/iter_test.go:62:7) of type *ast.AssignStmt failed for reason: unrecognized type of rhs in range statement: iter.Seq[int]
- /opt/hostedtoolcache/go/1.23.2/x64/src/internal/race/norace.go:1:1: INTERNAL ERROR(s):
- nilaway_assertion_analyzer: nilaway_function_analyzer: analyzing function AppendSeq at /opt/hostedtoolcache/go/1.23.2/x64/src/slices/iter.go:49.1: backpropagation across node (/opt/hostedtoolcache/go/1.23.2/x64/src/slices/iter.go:50:6) of type *ast.AssignStmt failed for reason: unrecognized type of rhs in range statement: iter.Seq[E]
- /opt/hostedtoolcache/go/1.23.2/x64/src/internal/race/norace.go:1:1: INTERNAL ERROR(s):
- nilaway_assertion_analyzer: nilaway_function_analyzer: analyzing function ExampleChunk at /opt/hostedtoolcache/go/1.23.2/x64/src/slices/example_test.go:388.1: backpropagation across node (/opt/hostedtoolcache/go/1.23.2/x64/src/slices/example_test.go:405:6) of type *ast.AssignStmt failed for reason: unrecognized type of rhs in range statement: iter.Seq[slices_test.People]
- analyzing function TestValues at /opt/hostedtoolcache/go/1.23.2/x64/src/slices/iter_test.go:58.1: backpropagation across node (/opt/hostedtoolcache/go/1.23.2/x64/src/slices/iter_test.go:66:7) of type *ast.AssignStmt failed for reason: unrecognized type of rhs in range statement: iter.Seq[int]
- analyzing function TestChunkRange at /opt/hostedtoolcache/go/1.23.2/x64/src/slices/iter_test.go:275.1: backpropagation across node (/opt/hostedtoolcache/go/1.23.2/x64/src/slices/iter_test.go:278:6) of type *ast.AssignStmt failed for reason: unrecognized type of rhs in range statement: iter.Seq[[]int]
- /opt/hostedtoolcache/go/1.23.2/x64/src/internal/race/norace.go:1:1: INTERNAL ERROR(s):
- nilaway_assertion_analyzer: nilaway_function_analyzer: analyzing function ExamplePreorder at /opt/hostedtoolcache/go/1.23.2/x64/src/go/ast/example_test.go:143.1: backpropagation across node (/opt/hostedtoolcache/go/1.23.2/x64/src/go/ast/example_test.go:159:6) of type *ast.AssignStmt failed for reason: unrecognized type of rhs in range statement: iter.Seq[go/ast.Node]
- analyzing function TestPreorderBreak at /opt/hostedtoolcache/go/1.23.2/x64/src/go/ast/walk_test.go:14.1: backpropagation across node (/opt/hostedtoolcache/go/1.23.2/x64/src/go/ast/walk_test.go:28:6) of type *ast.AssignStmt failed for reason: unrecognized type of rhs in range statement: iter.Seq[go/ast.Node]
- /opt/hostedtoolcache/go/1.23.2/x64/src/internal/race/norace.go:1:1: INTERNAL ERROR(s):
- nilaway_assertion_analyzer: nilaway_function_analyzer: analyzing function TestKeys at /opt/hostedtoolcache/go/1.23.2/x64/src/maps/iter_test.go:32.1: backpropagation across node (/opt/hostedtoolcache/go/1.23.2/x64/src/maps/iter_test.go:42:7) of type *ast.AssignStmt failed for reason: unrecognized type of rhs in range statement: iter.Seq[int]
- analyzing function TestValues at /opt/hostedtoolcache/go/1.23.2/x64/src/maps/iter_test.go:52.1: backpropagation across node (/opt/hostedtoolcache/go/1.23.2/x64/src/maps/iter_test.go:62:7) of type *ast.AssignStmt failed for reason: unrecognized type of rhs in range statement: iter.Seq[int]

Copy link
Contributor

@sonalmahajan15 sonalmahajan15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! Could you also add support for iter.Seq? The golden test is reporting internal errors.

@yuxincs
Copy link
Contributor Author

yuxincs commented Oct 10, 2024

Nice! Could you also add support for iter.Seq? The golden test is reporting internal errors.

This seems to be a separate issue we should handle, will do that in a follow-up PR :)

@yuxincs
Copy link
Contributor Author

yuxincs commented Oct 10, 2024

Nice! Could you also add support for iter.Seq? The golden test is reporting internal errors.

This seems to be a separate issue we should handle, will do that in a follow-up PR :)

Done in #288

Copy link
Contributor

@sonalmahajan15 sonalmahajan15 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome. Good to land after the needed support added in #288 .

@yuxincs yuxincs merged commit f74befd into main Oct 10, 2024
9 checks passed
@yuxincs yuxincs deleted the yuxincs/handle-type-alias branch October 10, 2024 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants