-
Notifications
You must be signed in to change notification settings - Fork 388
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
WIP fix(gnovm): PoC of inter-realm spec #2958
base: master
Are you sure you want to change the base?
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #2958 +/- ##
==========================================
+ Coverage 60.23% 60.30% +0.07%
==========================================
Files 562 562
Lines 75091 75286 +195
==========================================
+ Hits 45228 45399 +171
- Misses 26482 26505 +23
- Partials 3381 3382 +1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
(The "review team" label was added by mistake. This PR is opened by a core dev.) |
|
||
func (foo) Foo() { println("hello " + std.CurrentRealm().PkgPath()) } | ||
|
||
var fs []crossrealm.Fooer // panic |
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 should behave same with var f crossream.Fooer
, because the underlying array is persisted in the current realm, right?
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.
I think this should not panic; at initialization, no crossrealm.Fooer
is actually created (so it's all good), and then even on execution we can put in values of crossrealm.Fooer
which are not attached to this realm, but instead ie. created by crossrealm
- because it's an interface.
🛠 PR Checks SummaryAll Automated Checks passed. ✅ Manual Checks (for Reviewers):
Read More🤖 This bot helps streamline PR reviews by verifying automated checks and providing guidance for contributors and reviewers. ✅ Automated Checks (for Contributors):🟢 Maintainers must be able to edit this pull request (more info) ☑️ Contributor Actions:
☑️ Reviewer Actions:
📚 Resources:Debug
|
|
||
func main() { | ||
f := crossrealm_b.Fooer | ||
crossrealm.SetFooerGetter(func() crossrealm.Fooer { |
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.
the funcLit
is not attached to current realm, nor associated to any real object owned by current realm, so it's potentially valid to be attached to external realm, if it does not contain any objects not belongs to the target external realm.
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.
in this case, the object attached to other realm is the block using this funcLit as source, rather than its closure
.
func main() { | ||
f := crossrealm_b.Fooer | ||
crossrealm.SetFooerGetter(func() crossrealm.Fooer { | ||
f1 := Foo{} |
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.
f1
is owned by main
, then by package. so the funcLit is not permitted to be attached to external realm.
WIP: adding filetest for inter-realm spec, NOT FINAL.
relate: #2743
Contributors' checklist...
BREAKING CHANGE: xxx
message was included in the description