Mantis

View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0020812GameMaker Runner[All Projects] VariablesPublic2016-03-20 06:102016-06-23 14:58
ReporterOracizan 
Assigned ToRussell Kay 
PriorityMediumSeverityC - GeneralReproducibility100%
StatusClosedResolutionFixed 
PlatformWindowsOSWindowsOS Version7
Summary0020812: Equivalent expressions return different variable types
Descriptionvar a=1,
    b=(1==1);
    c=(a==1);

After the above is executed, b contains a real. c contains a boolean.
Additionally, real(c) causes the game to throw an error.
Steps To ReproduceRunning above code should be enough to reproduce.
GM Version1.4.1749
Attached Files? file icon Bugs.gmz [^] (372,161 bytes) 2016-03-20 06:10

- Relationships

-  Notes
(0043123)
rcusumano (Updater)
2016-04-27 18:40

0019983
0019982
0018963
0020914
0020553

all these bugs are the same problem - runner incorrectly treating booleans
(0043485)
Russell Kay (Manager)
2016-05-24 21:33

Runner is correctly treating booleans...

a is a number (no question)
b is a number (compiler will optimise out constants, and true is a constant 1)
c is calculated at runtime and is a boolean
(0043488)
GameGeisha (Updater)
2016-05-25 02:49

If that's the case, shouldn't the compiler pre-evaluate 1==1 to an actual Boolean true instead of 1? That's something to think about for the compiler, the implementation of true and false, and all functions that take true/false as arguments but currently accepts reals.
(0043969)
Russell Kay (Manager)
2016-06-14 21:14

Fixed in gitlab 529cd55
(0044226)
Stewart Bishop (Administrator)
2016-06-23 14:58

Confirming this now works as expected.


Copyright © 2000 - 2017 MantisBT Team
Powered by Mantis Bugtracker