Code Monkey home page Code Monkey logo

Comments (3)

pervognsen avatar pervognsen commented on June 11, 2024 1

Fixed, and added your repro case to test1 for regression testing.

from bitwise.

uucidl avatar uucidl commented on June 11, 2024

Result when compiling:

H:\bitwise>ion\ion repro && cl -W3 -nologo out_repro.c

Processed 102 symbols in 2 packages
Generated out_repro.c
out_repro.c
H:\bitwise\repro\repro_bug.ion(14): error C2231: '.rc': left operand points to 'struct', use '->'

Ion code:

struct Bar
{
    rc : int;
}

struct Foo
{
    bar : Bar* const;
}

func main () : int {
    bar := Bar{rc=42};
    foo := Foo{bar = &bar };
    return foo.bar.rc;
}

Generated C:

int main(void) {
    repro_Bar bar = {.rc = 42};
    repro_Foo foo = {.bar = &(bar)};
    return foo.bar.rc;
}

This is triggered only when using the const qualifier with the ptr member (bar).

from bitwise.

pervognsen avatar pervognsen commented on June 11, 2024

Thanks, I'll take a look.

from bitwise.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.