summaryrefslogtreecommitdiffhomepage
path: root/dart.html.markdown
diff options
context:
space:
mode:
authorKir Malev <playittodeath@gmail.com>2024-05-16 07:25:14 +0400
committerGitHub <noreply@github.com>2024-05-15 21:25:14 -0600
commitef5bdf1c52c601aa32ec0b1ba3175171876ef6ab (patch)
tree59be2a1cd23b0b04b5009ac5594d50860f69b2d7 /dart.html.markdown
parent5c518f4a316215d49c3efb1bed7846d44bf21b5b (diff)
[dart/en] Updated example14 (#3881)
Diffstat (limited to 'dart.html.markdown')
-rw-r--r--dart.html.markdown16
1 files changed, 8 insertions, 8 deletions
diff --git a/dart.html.markdown b/dart.html.markdown
index 69b1925b..4d2bf5ac 100644
--- a/dart.html.markdown
+++ b/dart.html.markdown
@@ -312,15 +312,15 @@ example14() {
if (a) {
print("true, a is $a");
}
- a = null;
+ a = false;
if (a) {
- print("true, a is $a");
+ print("true, a is $a");
} else {
print("false, a is $a"); /// runs here
}
- /// dynamic typed null can be convert to bool
- var b;/// b is dynamic type
+ /// dynamic typed null can not be convert to bool
+ var b; /// b is dynamic type
b = "abc";
try {
if (b) {
@@ -331,17 +331,17 @@ example14() {
} catch (e) {
print("error, b is $b"); /// this could be run but got error
}
- b = null;
- if (b) {
+ b = null;
+ if (b) { /// Failed assertion: boolean expression must not be null)
print("true, b is $b");
} else {
- print("false, b is $b"); /// runs here
+ print("false, b is $b");
}
/// statically typed null can not be convert to bool
var c = "abc";
c = null;
- /// complie failed
+ /// compilation failed
/// if (c) {
/// print("true, c is $c");
/// } else {