-
Notifications
You must be signed in to change notification settings - Fork 379
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.) |
Check this too: #2526 |
var b0 *crossrealm.Bar | ||
|
||
func init() { | ||
b0 = &crossrealm.Bar{A: 1} | ||
} | ||
|
||
func main() { | ||
print(".") | ||
} | ||
|
||
// XXX, should work to attach by reference to | ||
// type defined in another realm??? | ||
|
||
// Output: | ||
// . |
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.
is this right? &crossrealm.Bar{A: 1}
(from external realm) is persisted in current realm as a heapItemValue: heapitem((struct{(1 int)} gno.land/r/demo/tests/crossrealm.Bar))
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 is right, from my interpretation. The pointer goes to a value in the other realm, but it is attached to r/demo/crossrealm, so it's ok?
var b0 crossrealm.Bar // run declarations | ||
|
||
func main() { | ||
print(".") | ||
} | ||
|
||
// Error: | ||
// should not happen while attempting to attach new real object from 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.
forbid attach object by value with type defined in 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.
This panic looks correct to me, because Bar
is a struct so initialization would create a new value, which would be attached to crossrealm_test
but it cannot.
|
||
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 persistent 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.
WIP: adding filetest for inter-realm spec, NOT FINAL.
relate: #2743
Contributors' checklist...
BREAKING CHANGE: xxx
message was included in the description