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

mutable proto structs don't prevent type change during assingment #10

Closed
BeastyBlacksmith opened this issue Aug 19, 2022 · 2 comments · Fixed by #19
Closed

mutable proto structs don't prevent type change during assingment #10

BeastyBlacksmith opened this issue Aug 19, 2022 · 2 comments · Fixed by #19
Labels
enhancement New feature or request

Comments

@BeastyBlacksmith
Copy link
Owner

MWE:

@proto mutable struct A
    F::Int
end

a = A(1)
a.F = "2" #doesn't error
@BeastyBlacksmith
Copy link
Owner Author

It's not so difficult to fix the concretely typed case, but also handling abstract types and type parameters requires some thought.

@Tortar
Copy link
Contributor

Tortar commented Oct 12, 2023

It didn't also prevent this

@proto mutable struct A
    F::Int
end

a = A("2")

but in #19 it does :-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants