Discussion:
[dart-misc] Why don't my asserts work?
Danny Tuppeny
2017-02-17 10:27:44 UTC
Permalink
I have this code:

main() {
assert(1 == 0);
assert(1 == 1);
print("test");
}

I'm running with *--checked*, yet it doesn't crash it just outputs "test".
It seems broken to me, but it seems like the sort of thing somebody
would've noticed before (I can't find anything in the issue tracker).

It's Windows, SDK 1.22.0. Am I doing something silly, or should I raise a
bug?
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
'Vyacheslav Egorov' via Dart Misc
2017-02-17 10:36:33 UTC
Permalink
VM options should go before the dart file name otherwise they become
program options passed.

Try

dart --checked bin/main.dart
Post by Danny Tuppeny
main() {
assert(1 == 0);
assert(1 == 1);
print("test");
}
I'm running with *--checked*, yet it doesn't crash it just outputs
"test". It seems broken to me, but it seems like the sort of thing somebody
would've noticed before (I can't find anything in the issue tracker).
It's Windows, SDK 1.22.0. Am I doing something silly, or should I raise a
bug?
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an
--
// Vyacheslav Egorov
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Danny Tuppeny
2017-02-17 10:39:34 UTC
Permalink
Doh! I knew it'd be something silly. Thanks!

On Fri, 17 Feb 2017 at 10:36 'Vyacheslav Egorov' via Dart Misc <
Post by 'Vyacheslav Egorov' via Dart Misc
VM options should go before the dart file name otherwise they become
program options passed.
Try
dart --checked bin/main.dart
main() {
assert(1 == 0);
assert(1 == 1);
print("test");
}
I'm running with *--checked*, yet it doesn't crash it just outputs
"test". It seems broken to me, but it seems like the sort of thing somebody
would've noticed before (I can't find anything in the issue tracker).
It's Windows, SDK 1.22.0. Am I doing something silly, or should I raise a
bug?
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an
--
// Vyacheslav Egorov
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
'Bob Nystrom' via Dart Misc
2017-02-17 18:02:15 UTC
Permalink
Post by Danny Tuppeny
Doh! I knew it'd be something silly. Thanks!
If it makes you feel better, I make this mistake at least once every couple
of months.

– bob
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Jan Mostert
2017-02-17 18:40:11 UTC
Permalink
I've done it as well, haha
Maybe a warning saying your input params are out of place would nudge the
user in the right direction
Post by Danny Tuppeny
Doh! I knew it'd be something silly. Thanks!
If it makes you feel better, I make this mistake at least once every
couple of months.
– bob
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Günter Zöchbauer
2017-02-18 12:49:03 UTC
Permalink
On Friday, February 17, 2017 at 7:40:25 PM UTC+1, Jan Vladimir Mostert
Post by Jan Mostert
I've done it as well, haha
Maybe a warning saying your input params are out of place would nudge the
user in the right direction
That would make it invalid to use parameters like --checked (and all others
`dart` supports) for you Dart application
Post by Jan Mostert
On Fri, 17 Feb 2017 at 20:02 'Bob Nystrom' via Dart Misc <
Post by 'Bob Nystrom' via Dart Misc
Post by Danny Tuppeny
Doh! I knew it'd be something silly. Thanks!
If it makes you feel better, I make this mistake at least once every
couple of months.
– bob
--
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Danny Tuppeny
2017-02-18 19:59:17 UTC
Permalink
Post by Jan Mostert
Maybe a warning saying your input params are out of place would nudge the
user in the right direction
That would make it invalid to use parameters like --checked (and all
others `dart` supports) for you Dart application
I was gonna reply with the same, though he did say warn, so possibly you
could get away with it. Though I agree it's not a good idea - especially if
you might add new switches and start writing new output to stdout/stderr
when things consuming them might not expect it (Dart already does this when
you run Observatory to pass the port back; it's a bit weird IMO!).
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
'Stephen Adams' via Dart Misc
2017-02-18 20:27:46 UTC
Permalink
Post by Danny Tuppeny
Post by Jan Mostert
Maybe a warning saying your input params are out of place would nudge the
user in the right direction
That would make it invalid to use parameters like --checked (and all
others `dart` supports) for you Dart application
I was gonna reply with the same, though he did say warn, so possibly you
could get away with it. Though I agree it's not a good idea - especially if
you might add new switches and start writing new output to stdout/stderr
when things consuming them might not expect it (Dart already does this when
you run Observatory to pass the port back; it's a bit weird IMO!).
​dart2js is a Dart application that needs to allow --checked​ after the
entry point file name :-)
We would not want using dart2js to generate bogus hints, warnings or
whatever.
--
Post by Danny Tuppeny
For other discussions, see https://groups.google.com/a/dartlang.org/
For HOWTO questions, visit http://stackoverflow.com/tags/dart
To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups
"Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an
--
For other discussions, see https://groups.google.com/a/dartlang.org/

For HOWTO questions, visit http://stackoverflow.com/tags/dart

To file a bug report or feature request, go to http://www.dartbug.com/new
---
You received this message because you are subscribed to the Google Groups "Dart Misc" group.
To unsubscribe from this group and stop receiving emails from it, send an email to misc+***@dartlang.org.
Loading...