assert/2 crashes but should be legal #9753
Labels
area-language
Dart language related items (some items might be better tracked at github.com/dart-lang/language).
closed-duplicate
Closed in favor of an existing report
P2
A bug or feature request we're likely to work on
type-enhancement
A request for a change that isn't a bug
[ed note: I think this message comes from the VM]
With just
assert(false)
, it opens up the debugger.With
assert(false, "impossible")
it dies with this internal error (at runtime).This "syntax error" happens at runtime. It does not prevent the code from running. I'm guessing that "Internal error" means to report it?
Anyway, it would be nice if assert() allowed an optional second parameter String message, since otherwise it's going to mean falling back to good old
assert(condition && "message")
like in C/C++. One advantage of having the message as an actual parameter instead of using the&&
shim is to do something useful with it, like print it out (especially useful on the command line).////////////////////////////////////////////////////////////////////////////////////
Editor: 0.4.4_r20810 (2013-04-03)
OS: Linux - amd64 (3.5.0-26-generic)
JVM: 1.7.0_15
projects: 5
open dart files: 2
auto-run pub: true
localhost resolves to: 127.0.0.1
mem max/total/free: 889 / 463 / 218 MB
thread count: 33
analysis: 0 tasks, 29 libraries, 6 contexts
index: 85962 relationships and 0 attributes in 15459 elements in 147 resources stored in 2 MB on disk
SDK installed: true
Dartium installed: true
analysis engine: dartc
Attachment:
screenshot.png (116.36 KB)
The text was updated successfully, but these errors were encountered: