Thanks to visit codestin.com
Credit goes to github.com

Skip to content

int a @if(0); failed to compile #2086

@LukyGuyLucky

Description

@LukyGuyLucky

Given below code:

fn void main()
{
    int $a=0;
    if($a){} //ok
    int a @if(!$a);//ok
    int a @if($a);// Error: Expected a boolean compile time constant value
    int a @if((bool)$a);//ok
}

May I ask is this the intended design?

Metadata

Metadata

Assignees

Labels

BugSomething isn't workingFixed needs testingNeeds verification / testing that it now works

Type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions