Comments (5)
I'd say this is a valid error. Perhaps the error message should be more explicit, but I think it should fail, regardless of what legacy bcc does.
from bcc.
If course I think NG is allowed to error on more things - as long as it explains why it is failing. Do not misunderstand me: I know that the issues are errors in my code :p
from bcc.
While "return a(1)" is a valid error - shouldnt a subtraction of "void" result in something like 0?
No ... I am not "joking" (albeit I started this comment to write something not that serious)
The function b:int() returns an integer value. When doing the math operation of "void - void" you should end up with "0", same for "void/void" = "1". I mean, these are rare special cases and really constructed ... but maybe there are more cases of "math(void)" returning real mathematic values.
I still understand, that the above is something really "constructed" and no real-world-scenario.
from bcc.
If you are using Strict, then you can do what you like.
However, I think SuperStrict should at least try to be super-strict, otherwise we may want to rename it to something like "MostlySuperStrict" :-)
In legacy BlitzMax, all functions return at least Int, regardless of strictness. C doesn't let you mix and match, and it turns out that emscripten really doesn't like you doing "fun" things with inappropriately mixed function signatures. (You may consider emscripten to be ReallySuperStrict)
On 23 Jan 2015, at 16:09, Ronny Otto [email protected] wrote:
While "return a(1)" is a valid error - shouldnt a subtraction of "void" result in something like 0?
No ... I am not "joking" (albeit I started this comment to write something not that serious)
The function b:int() returns an integer value. When doing the math operation of "void - void" you should end up with "0", same for "void/void" = "1". I mean, these are rare special cases and really constructed ... but maybe there are more cases of "math(void)" returning real mathematic values.
I still understand, that the above is something really "constructed" and no real-world-scenario.
—
Reply to this email directly or view it on GitHub.
from bcc.
Like said: I am totally open for just not allowing void as result for something different ... stay tuned for next issues :p
You may close this issue when introducing an error-message ("invalid return type").
from bcc.
Related Issues (20)
- Globals in For Loops ( or other "blocks" ) HOT 3
- Feature request for using an enum value within an enum
- Compile Error: Expecting expression but encountered @bmk
- "exit" inside functions not always caught by bcc
- Include & Incbin reports wrong line on file not found
- Importing of generics not working HOT 2
- Try/Catch in release builds (code there but not throwing) HOT 6
- Bug with extending generic types HOT 10
- Unsupported type for name mangling HOT 4
- [Generics] Using object as argument
- [Generics] Nested generics & import issue
- BCC allows to access multi-dim arrays with less/more dimensions HOT 1
- Multi-dim-access to a single-dim array with "incorrect" C Code (not caught with BCC error message)
- Question: Why do "release-build" type-structs contain debug struct information? HOT 2
- [Generics] EachIn type conversion HOT 1
- Normal Debug build EAVs, GDB Debug build works - only affects x86 builds HOT 1
- Automatic string to byte ptr generation
- @bmk Pragma broken since 0.139
- [Generics] Crash, Possible C code casting bug? HOT 2
- Compilation of BCC with legacy - math.c issues
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bcc.