Skip to content

Ternary operator: expected an expression, but got 'throw' #8626

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
stevemessick opened this issue Feb 19, 2013 · 1 comment
Closed

Ternary operator: expected an expression, but got 'throw' #8626

stevemessick opened this issue Feb 19, 2013 · 1 comment
Assignees
Labels
closed-duplicate Closed in favor of an existing report web-dart2js

Comments

@stevemessick
Copy link
Contributor

Dart2JS

In editor, -> Run as JavaScript:

  var _data;
  bool _isValid = false;
  ...
  bool get isValid => _isValid;
  dynamic get data => _isValid ? _data : throw "Message structure is still incomplete";

Compliation fails with:
expected an expression, but got 'throw'

data type could be any inbuilt type, obviously this compiles ok if I wrap in {if...else...}

////////////////////////////////////////////////////////////////////////////////////
Editor: 0.3.5_r18300 (2013-02-08)
OS: Windows 7 - amd64 (6.1)
JVM: 1.7.0_13

projects: 1

open dart files: 0

auto-run pub: true
mem max/total/free: 889 / 198 / 142 MB
thread count: 26
analysis: 0 tasks, 65 libraries, 2 contexts
index: 87111 relationships and 0 attributes in 15889 elements in 203 resources stored in 3 MB on disk

SDK installed: true
Dartium installed: true

@peter-ahe-google
Copy link
Contributor

Added Duplicate label.
Marked as being merged into #4874.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
closed-duplicate Closed in favor of an existing report web-dart2js
Projects
None yet
Development

No branches or pull requests

3 participants