Project

General

Profile

Actions

Bug #959

open

Boolean function results are not working on If statement.

Added by Brian Flanagan about 2 years ago. Updated almost 2 years ago.

Status:
New
Priority:
High
Target version:
Start date:
12/03/2022
Due date:
% Done:

0%

Estimated time:
Affected version:

Description

Example:

Function CantMoveDown
End Function(True)

// This code fails
Procedure MoveDown
  Print CantMoveDown
  If CantMoveDown
    Say "cannot"
  End If
  If Not CantMoveDown
    Say "can"
  End If
End Procedure

/*
// This code works
Procedure MoveDown
  Print CantMoveDown
  If (CantMoveDown=True)
    Say "cannot"
  End If
  If Not (CantMoveDown=True)
    Say "can"
  End If
End Procedure
*/

Print "Waiting..."
Do
    Wait Key
    MoveDown
    If Upper$(Inkey$)="Q" Then Exit
Loop
End

If you comment the first procedure version, and uncomment the second, you'll find that if you explicitly check the value
of true or false, it works, but apparently the If statement does not evauluate the value of a simple boolean result properly.

This was tested using the newest source from .git as of 11/27.

Actions #1

Updated by Brian Flanagan about 2 years ago

Note also that Print evaluates the result properly. If is the problem.

Actions #2

Updated by Brian Flanagan about 2 years ago

  • Priority changed from Normal to High
Actions #3

Updated by Francois Lionet almost 2 years ago

Fixed! Bad bug in the transpiler.

Actions

Also available in: Atom PDF