-
Notifications
You must be signed in to change notification settings - Fork 367
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
28 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
package main | ||
|
||
func main() { | ||
println(X()) | ||
} | ||
|
||
func X() string { | ||
return "hello" || "world" | ||
} | ||
|
||
// Error: | ||
// main/files/bool6.gno:8: operands of boolean operators must evaluate to boolean typed values |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package main | ||
|
||
// Ensure, when comparing evaluated boolean operand types, that the kinds produced | ||
// are the same when one operand is typed and the other is untyped. | ||
func main() { | ||
println(boolAndTrue(true)) | ||
println(boolAndTrue(false)) | ||
} | ||
|
||
func boolAndTrue(b bool) bool { | ||
return b && true | ||
} | ||
|
||
// Output: | ||
// true | ||
// false |