You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
type Foo is (Bar box | Baz box | Bool)
class Bar
embed _items: Array[Foo] = _items.create()
new create(items: ReadSeq[Foo]) =>
for item in items.values() do
_items.push(item)
end
class Baz
actor Main
new create(env: Env) =>
let bar = Bar([
true
Bar([ false ])
])
env.out.print("done")
we get the errors:
Error:
main.pony:17:10: array element not a subtype of specified array type
Bar([ false ])
^
Info:
main.pony:6:29: array type: (this->Bar box | this->Baz box | Bool val)
new create(items: ReadSeq[Foo]) =>
^
main.pony:6:3: element type: Bar ref^
new create(items: ReadSeq[Foo]) =>
^
main.pony:6:3: Bar ref^ is not a subtype of Bar val: ref^ is not a subcap of val
new create(items: ReadSeq[Foo]) =>
^
main.pony:6:3: Bar ref^ is not a subtype of Baz box^
new create(items: ReadSeq[Foo]) =>
^
main.pony:6:3: Bar ref^ is not a subtype of Bool val^
new create(items: ReadSeq[Foo]) =>
^
main.pony:6:3: Bar ref^ is not a subtype of any element of (this->Bar box^ | this->Baz box^ | Bool val^)
new create(items: ReadSeq[Foo]) =>
^
Notice the the third info section erroneously says Bar ref^ is not a subtype of Bar val, where it should be checking against Bar box^, since type Foo is (Bar box | Baz box | Bool). Indeed in the next section it correctly checks against Baz box^.
The text was updated successfully, but these errors were encountered:
When compiling the following code:
we get the errors:
Notice the the third info section erroneously says
Bar ref^ is not a subtype of Bar val
, where it should be checking againstBar box^
, since typeFoo
is(Bar box | Baz box | Bool)
. Indeed in the next section it correctly checks againstBaz box^
.The text was updated successfully, but these errors were encountered: