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

Bad error returned with New #29

Closed
mskfox opened this issue Aug 23, 2021 · 4 comments
Closed

Bad error returned with New #29

mskfox opened this issue Aug 23, 2021 · 4 comments
Labels
status: duplicate This issue or pull request already exists

Comments

@mskfox
Copy link
Contributor

mskfox commented Aug 23, 2021

When we create a new Instance using New and we set a property with a boolean state, an error is returned saying that the instance does not have this property.

However, when we transform our 'state' into a string using tostring, it works.

local myState = State(true)

New 'TextLabel' {
    -- Working
    Text = Computed(function()
        return tostring(myState:get())
    end)
    -- Working
    Text = tostring(myState:get())
    -- Return [Fusion] The class type 'TextLabel' has no assignable property 'Text'. (ID: cannotAssignProperty)
    Text = myState:get()
},

The wrong error is therefore sent.

@Gargafield
Copy link
Contributor

Isn't this a lot like #22?

@dphfox dphfox closed this as completed Aug 24, 2021
@dphfox
Copy link
Owner

dphfox commented Aug 24, 2021

Duplicate of #22

@dphfox dphfox marked this as a duplicate of #22 Aug 24, 2021
@dphfox dphfox added the status: duplicate This issue or pull request already exists label Aug 24, 2021
@mskfox
Copy link
Contributor Author

mskfox commented Aug 24, 2021

Oh sorry :x

@dphfox
Copy link
Owner

dphfox commented Aug 26, 2021

Oh sorry :x

no worries! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

3 participants