AdeptLanguage / Adept

The Adept Programming Language
GNU General Public License v3.0
121 stars 9 forks source link

[bug] print() printing signed numbers bug #17

Closed ghost closed 4 years ago

ghost commented 4 years ago

@IsaacShelton

code:

import basics

func main()
{
        i int = 0
        i-- // i -= 1 also not works
        print(i)
}

result:

4294967295

should be:

-1
IsaacShelton commented 4 years ago

@t0md3an I think this is a problem with print($T~__primitive__)/toString($T~__primitive__) prioritizing a previously instantiated version, I'll take a look at it soon

ghost commented 4 years ago

@IsaacShelton Yes, the problem is in print():

print(-1) // returns 4294967295
IsaacShelton commented 4 years ago

@t0md3an It turned out to be an issue with not sign-extending integers when they needed it, but it is fixed now.