Comments (6)
Same issue there:
static inline function allocUID() : UID {
return (SEQ << (#if hxbit64 64 #else 32 #end - SEQ_BITS)) | (++UID);
}
With hxbit.UID should be Int
on ++UID
. Reverting a57c74c fixes that.
from haxe.
I have no intuition for how accessor + operator overload should interact here. Should this behave the same way as the +=
case or what?
from haxe.
The case of @kLabz is exactly why I open this issue. I'm replacing it locally to continue my dev, with
UID += 1;
return (SEQ << (#if hxbit64 64 #else 32 #end - SEQ_BITS)) | (UID);
from haxe.
@Simn if we have a + operator, we should be able to use +=
and prefix/postfix ++
, by generating the following code:
x += 1; // x = X.add(x,1)
++x; // same
x++; // { var tmp = x; x = X.add(x,1); tmp; }
from haxe.
Ok hang on, the specification is really not clear to me. We can have three different kinds of operator overload:
@:op(A + B)
@:op(A += B)
@:op(++A)
If I'm understanding what you're saying correctly, the following should be true:
- An expression
a + b
only checks for@:op(A + B)
- An expression
a += b
checks for@:op(A += B)
, and if that's not applicable it checks for@:op(A + B)
- An expression
++a
checks for@:op(++A)
, and if that's not applicable it checks for@:op(A += B)
, and if that's not applicable it checks for@:op(A + B)
Is that correct? Note that I'm not even talking about getters/setters because it seems like the problem here starts even earlier.
from haxe.
I thought that @:op(A++)
is defined for haxe.Int64 which will performs an add1 (seems quite natural for me as that's an Int), I must have misunderstood something :'(
If I recall correctly, @ncannasse said that ++ on String should not be valid (but there is a + on String), so I do not think ++ should automatically performs a +1
from haxe.
Related Issues (20)
- [dev] Field index for SSL_IS_SERVER not found on prototype mbedtls._SslEndpoint.SslEndpoint_Impl_ HOT 2
- Any way to set a function property? HOT 1
- Iterable arg is not inlineable
- How to create ComplexType representing anonymous structure with optional fields? HOT 1
- Inline function with continue inside loop no longer works HOT 4
- @:generic compilation error when the function is called multiple times
- Hashlink HL/C CArray code generation has unnecessary cast for known types. HOT 3
- Reflect.hasField returns false on property getters on the JavaScript target HOT 1
- Generics regression HOT 2
- Erroneous "Unused import/using" when importing module types
- Self-contained compiler support request HOT 1
- Missing type parameter info when return type inferred from interface HOT 1
- Closures are not inlined when used through another inline closure
- Bug during haxe --macro Field index for SSL_IS_SERVER not found HOT 1
- Fatal error: exception EvalContext.RunTimeException(_, 0, _) HOT 1
- [js] It would be nice to have a more elegant output of default arguments in es6 HOT 4
- Add thousand seperator for numeric format HOT 3
- Macro interpreter memory leak, up to 24GB RAM usage observed HOT 10
- Strange macro behavior with server during heaps shader generation
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 haxe.