Skip to content
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

Fix: check computed members against listing/mapping owner #822

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

bioball
Copy link
Contributor

@bioball bioball commented Nov 17, 2024

This addresses a regression where a value can possibly not be type-casted correctly.

Closes #785

This addresses a regression where a value can possibly not be
type-casted correctly.
@translatenix
Copy link
Contributor

translatenix commented Nov 18, 2024

Only executing owner's and receiver's type cast is insufficient. New test:

local a = new Listing { new Foo {} }
local b = (a) { new Bar {} }
local c = b as Listing<Bar>
local d = (c) { new Foo {} }
local e = d as Listing<Foo>

result = e

open class Foo
class Bar extends Foo

The easiest fix is to switch to my implementation. :-)

@bioball
Copy link
Contributor Author

bioball commented Nov 20, 2024

Ah, yup, you're right! I see what you mean now by it being insufficient to just check the owner and receiver.

I'll take a closer look at your PR.

@bioball bioball marked this pull request as draft November 20, 2024 23:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Semantics of Listing typechecks have changed in 0.27
2 participants