-
Notifications
You must be signed in to change notification settings - Fork 48
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
Types and values not checked correctly #80
Comments
tell me, for the sport, what does it compile to? (as in, if it produces any C code) 😃 |
Compiles to |
Btw I enabled sizeof(Foo.x) where x is a member of Foo. So I first saw this when it swallowed i32 a = Foo.a for exactly the same reasons. I thought it was my code that had the problem but it was a general bug. But I actually think it would be good to be able have types as first class constructs. I wrote about it in the forum. |
You mean base types? (as first class constructs)
Foo.a should just be an error if a is a real member and not a struct
function.
…On Sat, Dec 1, 2018 at 6:17 PM Christoffer Lerno ***@***.***> wrote:
Btw I enabled sizeof(Foo.x) where x is a member of Foo. So I first saw
this when it swallowed i32 a = Foo.a for exactly the same reasons. I
thought it was my code that had the problem but it was a general bug.
But I actually think it would be good to be able have types as first class
constructs. I wrote about it in the forum.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#80 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAC1mnK5sJHhFkeyq6AooHKfvi3WtHOAks5u0rmsgaJpZM4Y89vD>
.
|
No, I mean that the type could be manipulated as an entity and assigned to variables.
”Foo.a” is treated as a reference to the member of Foo called ”a”.
For offset, we can then use offset(Foo.a) instead of offset(Foo, a), it also made sizeof(Foo.a) simple to do.
So the error for i32 a = Foo.a should be ”cannot assign struct member type to i32”
/C
… On 2 Dec 2018, at 12:09, Bas van den Berg ***@***.***> wrote:
You mean base types? (as first class constructs)
Foo.a should just be an error if a is a real member and not a struct
function.
On Sat, Dec 1, 2018 at 6:17 PM Christoffer Lerno ***@***.***>
wrote:
> Btw I enabled sizeof(Foo.x) where x is a member of Foo. So I first saw
> this when it swallowed i32 a = Foo.a for exactly the same reasons. I
> thought it was my code that had the problem but it was a general bug.
>
> But I actually think it would be good to be able have types as first class
> constructs. I wrote about it in the forum.
>
> —
> You are receiving this because you are subscribed to this thread.
> Reply to this email directly, view it on GitHub
> <#80 (comment)>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AAC1mnK5sJHhFkeyq6AooHKfvi3WtHOAks5u0rmsgaJpZM4Y89vD>
> .
>
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub <#80 (comment)>, or mute the thread <https://github.com/notifications/unsubscribe-auth/AABtVXjWam45EndfY9h2ijLwq9EZxdNgks5u07UDgaJpZM4Y89vD>.
|
This is possible:
Because we do not check during assignment whether Foo an expression-type or an expression with the type Foo.
The text was updated successfully, but these errors were encountered: