Giter VIP home page Giter VIP logo

Comments (6)

adiee5 avatar adiee5 commented on August 25, 2024 2

yeah, let desertfish see it, so he can add a proper error message

from prog8.

adiee5 avatar adiee5 commented on August 25, 2024 1

I think I know, what could cause it?

void = call(workFunc)

technically, the correct syntax for ignoring a return value from a single return value function is this:

void call(workFunc)

void = syntax wasn't a thing until multi-return syntax was added recently, and I guess the handling of void = for regular functions wasn't added, so stuff happen.

But that's just my thesis.

from prog8.

djehuti avatar djehuti commented on August 25, 2024

Yup, that fixes it. That's a fine workaround for me! (I'm used to that syntax.)

from prog8.

djehuti avatar djehuti commented on August 25, 2024

I'll let you ( @irmen ) decide whether to keep this open to handle that or just close it.

from prog8.

irmen avatar irmen commented on August 25, 2024

With -target virtual, it also crashes, but with a different error

Exception in thread "main" java.lang.IllegalArgumentException: node prog8.code.ast.PtFunctionCall@ccd1bc3 name is not scoped: call
at prog8.codegen.intermediate.IRCodeGen.verifyNameScoping$verifyPtNode(IRCodeGen.kt:65)
at prog8.codegen.intermediate.IRCodeGen.verifyNameScoping$verifyPtNode(IRCodeGen.kt:79)
at prog8.codegen.intermediate.IRCodeGen.verifyNameScoping$verifyPtNode(IRCodeGen.kt:79)
at prog8.codegen.intermediate.IRCodeGen.verifyNameScoping$verifyPtNode(IRCodeGen.kt:79)
at prog8.codegen.intermediate.IRCodeGen.verifyNameScoping(IRCodeGen.kt:90)
at prog8.codegen.intermediate.IRCodeGen.generate(IRCodeGen.kt:26)

from prog8.

irmen avatar irmen commented on August 25, 2024

Minimal reproduction:

main {
  sub start() {
    void = call($2000)
  }
}

related compiler crash:

main {
  sub start() {
    void = 123
  }
}

from prog8.

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.