View Issue Details [ Jump to Notes ] | [ Issue History ] [ Print ] | ||||||||||||
ID | Project | Category | View Status | Date Submitted | Last Update | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
0001705 | OpenClonk | Engine - C4Script | public | 2016-03-13 16:54 | 2017-08-20 12:06 | ||||||||
Reporter | Luchs | ||||||||||||
Assigned To | |||||||||||||
Priority | normal | Severity | minor | Reproducibility | always | ||||||||
Status | new | Resolution | open | ||||||||||
Product Version | |||||||||||||
Target Version | 9.0 | Fixed in Version | |||||||||||
Summary | 0001705: Automatic type conversion bool -> int in function parameters | ||||||||||||
Description | For a function taking an "int" parameter, "bool" is accepted as well. However, the bool isn't converted to an int, which breaks comparisons. Passing a "bool" as an "int" should either produce an error or convert the bool to 0 or 1. | ||||||||||||
Steps To Reproduce | % c4script -e 'func Main() { Log("%v", broken(false)); } func broken(int x) { return x == 0; }' false % c4script -e 'func Main() { Log("%v", broken(true)); } func broken(int x) { return x == 1; }' false | ||||||||||||
Tags | No tags attached. | ||||||||||||
Attached Files |
|