-
Notifications
You must be signed in to change notification settings - Fork 245
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(go): runtime type check type unions #3712
Conversation
Runtime type-checking can be disabled by adding `--tag=no_runtime_type_checks` to go compiler invocations. This can be used to avoid paying the performance toll of runtime type checking (which should be modest in most cases), or to work around a bug in the type checking code.
f3d033f
to
441fe5b
Compare
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.
just a few small comments! Looks great.
packages/@jsii/go-runtime/jsii-runtime-go/internal/typeregistry/registration.go
Show resolved
Hide resolved
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.
This is a massive change to the generated code, so I think it would be worthwhile to add a test to confirm that the runtime checks being disabled produces no changes - what do you think?
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.
one tiny cosmetic comment
packages/@jsii/go-runtime-test/project/runtime_type_checking_test.go
Outdated
Show resolved
Hide resolved
# Conflicts: # packages/jsii-pacmak/test/generated-code/__snapshots__/target-dotnet.test.js.snap # packages/jsii-pacmak/test/generated-code/__snapshots__/target-go.test.js.snap # packages/jsii-pacmak/test/generated-code/__snapshots__/target-python.test.js.snap
Runtime type-checking can be disabled by adding
--tag=no_runtime_type_checking
to go compiler invocations. This canbe used to avoid paying the performance toll of runtime type checking
(which should be modest in most cases), or to work around a bug in the
type checking code.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.