-
-
Notifications
You must be signed in to change notification settings - Fork 419
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
this->X!
should not be a subtype of this->X
#1798
Comments
this->X!
is a subtype of this->X
this->X!
should not be a subtype of this->X
Simpler test case, which relies on class Foo
fun alias[X](x: X!) : X^ =>
let y : ref->X = consume x
consume y |
This looks like a bug in
Which is good! But then we need to compare those. And when we have:
It reifies as:
This is bad!
|
This no longer compiles. I believe this has been fixed, but leaving open for discussion at sync.
|
Note that this example: #1798 (comment) still compiles and is problematic. The main example no longer works because |
Reduced test case, this creates three references
x
,y
andz
to the same object,Unless
X
is bounded by#share
(or similar), this should not be allowed.This can be used to create two
iso
references to the same object, as shown in the snippet below.The clone method aliases
this.a
, which results in athis->A!
. However this bug allows it to cast it to athis->A
.Playground link : https://is.gd/6gwQK4
Pony version :
The text was updated successfully, but these errors were encountered: