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

fix const of selector trap #181

Merged
merged 1 commit into from
Jun 2, 2024
Merged

fix const of selector trap #181

merged 1 commit into from
Jun 2, 2024

Conversation

xhd2015
Copy link
Owner

@xhd2015 xhd2015 commented Jun 2, 2024

A regression fix when introducing #180

Addressing #182

@xhd2015 xhd2015 added the bug Something isn't working label Jun 2, 2024
@xhd2015
Copy link
Owner Author

xhd2015 commented Jun 2, 2024

This fails to compile:

const (
	// The amount of time the nodecontroller should sleep between retrying node health updates
	retrySleepTime = 20 * time.Millisecond
)

func TestArrayPointer(t *testing.T) {
	a := retrySleepTime * ext.NodeHealthUpdateRetry
	_ = a
}

ext:

package ext

const (
	// NodeHealthUpdateRetry controls the number of retries of writing
	// node health update.
	NodeHealthUpdateRetry = 5
)

Test:

$ go run -tags dev ./cmd/xgo test --project-dir runtime/test/debug
# github.com/xhd2015/xgo/runtime/test/debug [github.com/xhd2015/xgo/runtime/test/debug.test]
./debug_test.go:24:27: internal compiler error: time.Duration is not assignable to int

Please file a bug report including a short program that triggers the error.
https://go.dev/issue/new
FAIL    github.com/xhd2015/xgo/runtime/test/debug [build failed]
exit status 1
exit status 1

@xhd2015 xhd2015 force-pushed the fix-const-selector-trap branch from b868d6f to f3e4e31 Compare June 2, 2024 06:28
@xhd2015 xhd2015 merged commit f3e4e31 into master Jun 2, 2024
7 checks passed
@xhd2015 xhd2015 deleted the fix-const-selector-trap branch June 2, 2024 06:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant