-
Notifications
You must be signed in to change notification settings - Fork 32
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
feat:ZeroLit for alias #489
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #489 +/- ##
=======================================
Coverage 96.00% 96.00%
=======================================
Files 21 21
Lines 7156 7159 +3
=======================================
+ Hits 6870 6873 +3
Misses 222 222
Partials 64 64 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
codebuild.go
Outdated
@@ -768,6 +768,9 @@ retry: | |||
case *types.Named: | |||
typ = p.getUnderlying(t) | |||
goto retry | |||
case *types.Alias: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
typesutil.Alias
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
.github/workflows/go.yml
Outdated
@@ -51,6 +51,9 @@ jobs: | |||
go work init . | |||
go work edit -replace golang.org/x/tools=golang.org/x/[email protected] | |||
|
|||
- name: Set types alias env |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
上面的 go work init 自动加入了 go 1.23/1.24 默认为 typesalias 环境。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
82e12c7
to
fcbd255
Compare
fix unexpected zero lit for alias type
without alias support in
ZeroLit
,will cause unexpect zerolit for a bulitin type's alias,like usegoplus/llgo/c.Double
https://github.com/goplus/llcppg/actions/runs/14375203222/job/40305873425?pr=244
support goplus/llcppg#244
reproduce
go.mod
note:use
replace golang.org/x/tools => golang.org/x/tools v0.30.0
to ref a alias's name instead it's origin type.without this
replace
the hellowith this replace,we can refer the actual alias type
but in this case,we will get a error zerolit of
c.Double
invalid composite literal type c.Double compiler[InvalidLit](https://pkg.go.dev/golang.org/x/tools/internal/typesinternal#InvalidLit)
with this pr,we can got a correct alias zerolit
