-
Notifications
You must be signed in to change notification settings - Fork 355
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
go2Gno loses type info #1966
Comments
Maybe the issue has been resolved. I will try to reproduce it. I encountered an issue with the compilation. Code: package time
import (
"fmt"
"std"
"testing"
"time"
)
func TestTime(t *testing.T) {
var a int64 = 2
fmt.Println(time.Second * a)
} Issue on lint: time_test.gno:12: incompatible types in binary expression: time<VPBlock(2,3)>.Second MUL a<VPBlock(1,1)> (code=2). |
It happens when test with native, you can check |
Thank you I can reproduce it now :) |
#2016) fixes #1966 <!-- please provide a detailed description of the changes made in this pull request. --> <details><summary>Contributors' checklist...</summary> - [ ] Added new tests, or not needed, or not feasible - [ ] Provided an example (e.g. screenshot) to aid review or the PR is self-explanatory - [ ] Updated the official documentation or not needed - [ ] No breaking changes were made, or a `BREAKING CHANGE: xxx` message was included in the description - [ ] Added references to related issues and PRs - [ ] Provided any useful hints for running manual tests - [ ] Added new benchmarks to [generated graphs](https://gnoland.github.io/benchmarks), if any. More info [here](https://github.com/gnolang/gno/blob/master/.benchmarks/README.md). </details>
see this:
this would not compile in Go, but works in gno. the reason for it is while converting from go to gno, time.Duration is treated as a int64 rather than the time.Duration, the declared type is lost.
The text was updated successfully, but these errors were encountered: