Skip to content
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

I'm not surprised: assemble-dart not working #58

Open
welopino opened this issue Jun 30, 2017 · 6 comments
Open

I'm not surprised: assemble-dart not working #58

welopino opened this issue Jun 30, 2017 · 6 comments
Assignees
Labels
Milestone

Comments

@welopino
Copy link

welopino commented Jun 30, 2017

I am using ceylon 1.3.2 and the corresponding ceylon-dart plugin.

running:

$ ./bin/ceylon assemble-dart --mode=js --out=first-assembly first

gives:

/tmp/ceylon-run-dart1838713660084194959/ceylon/dart/runtime/model/model.dart:836:3:
Error: Unexpected token 'Function'.
  Function([Scope container, $dart$core.String name, $dart$core.Object typeLG, $dart$core.Object qualifier = $ceylon$language.dart$default, $dart$core.Object isDeclaredVoid = $ceylon$language.dart$default, $dart$core.Object isShared = $ceylon$language.dart$default, $dart$core.Object isFormal = $ceylon$language.dart$default, $dart$core.Object isActual = $ceylon$language.dart$default, $dart$core.Object isDefault = $ceylon$language.dart$default, $dart$core.Object isAnnotation = $ceylon$language.dart$default, $dart$core.Object isDeprecated = $ceylon$language.dart$default, $dart$core.Object isStatic = $ceylon$language.dart$default, $dart$core.Object isAnonymous = $ceylon$language.dart$default, $dart$core.Object isNamed = $ceylon$language.dart$default, $dart$core.Object isDynamic = $ceylon$language.dart$default, $dart$core.Object annotations = $ceylon$language.dart$default, $dart$core.Object unit = $ceylon$language.dart$default]) : this.$s((() {
  ^^^^^^^^
Error: Compilation failed.
ceylon assemble-dart: dart2js reported an error.

The assembling tool of the java backend of version 1.3.2 doesn't work correctly either. Possibly those issues are related.

@welopino welopino changed the title assemble-dart not working I'm not surprised: assemble-dart not working Jun 30, 2017
@jvasileff jvasileff added the bug label Jun 30, 2017
@jvasileff jvasileff added this to the DP5 milestone Jun 30, 2017
@jvasileff jvasileff self-assigned this Jun 30, 2017
@jvasileff
Copy link
Owner

Ooops, looks like recent versions of Dart are not happy with using Function as an identifier. This should be easy to fix.

Thanks for the report.

@welopino
Copy link
Author

welopino commented Jun 30, 2017

Ok, it has nothing to do with eclipse-archived/ceylon#6956 ?!

@jvasileff
Copy link
Owner

Right, they don't share any code.

@jvasileff
Copy link
Owner

@welopino as a workaround, you can use Dart version 1.19.1.

@jvasileff
Copy link
Owner

Working example, using node to run a Ceylon/Dart program:

jvasileff@tau:tmp.Yboq6CCf$ cat source/simple/run.ceylon
"Run the module `simple`."
shared void run() {
    print("hello");
}

jvasileff@tau:tmp.Yboq6CCf$ ceylon compile-dart simple
Note: Created module simple/1.0.0

jvasileff@tau:tmp.Yboq6CCf$ ceylon assemble-dart --mode=js simple
Dart file (/var/folders/cw/vkgzjns15b14q4r5g992gwdw0000gn/T/ceylon-run-dart4054175707493727852/simple/simple.dart) compiled to JavaScript: /var/folders/cw/vkgzjns15b14q4r5g992gwdw0000gn/T/5488022163303916103.tmp
Created executable Dart script simple.js

jvasileff@tau:tmp.Yboq6CCf$ cat /Users/jvasileff/Transient/dart/dart-sdk/lib/_internal/js_runtime/lib/preambles/d8.js simple.js > simple-node.js

jvasileff@tau:tmp.Yboq6CCf$ node simple-node.js
hello

jvasileff@tau:tmp.Yboq6CCf$ dart --version
Dart VM version: 1.19.1 (Wed Sep  7 08:59:17 2016) on "macos_x64"

@jvasileff
Copy link
Owner

More on this here: dart-lang/sdk#28610

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants