Giter VIP home page Giter VIP logo

ceylon-dart's Introduction

Build Status

Dart backend for Ceylon

Update (6/5/2017)

Developer preview release 4 (DP4) of the Dart backend for Ceylon is now available

This release is compatable with Ceylon 1.3.2 and contains several bug fixes and enhancements over DP3.

Update (9/27/2016)

Developer preview release 3 (DP3) of the Dart backend for Ceylon is now available

This release is compatable with Ceylon 1.3.0 and contains several bug fixes and enhancements over DP2.

Update (7/13/2016)

Developer preview release 2 (DP2) of the Dart backend for Ceylon is now available

This release includes:

  • Complete support for the Ceylon 1.2.2 language, except reified generics and the metamodel.
  • A familiar CLI for compiling and running Ceylon programs (ceylon compile-dart and ceylon run-dart).
  • A powerful application assembly tool (ceylon assemble-dart) that can produce distributable Dart VM applications, single file Dart VM applications, and single file JavaScript applications.
  • Eleven Ceylon SDK modules
  • Initial support for Dart interop, including async/await, the ceylon.interop.dart module, and the ability to import and use 11 native Dart modules such as dart.core, dart.collection, and dart.html.

Installing the Dart backend for Ceylon

The commandline interface for the Dart backend is available on [Ceylon Herd] (https://modules.ceylon-lang.org/modules/com.vasileff.ceylon.dart.cli), and can be easily installed on any OS X or Linux system.

Step 1: Install Ceylon

To install Ceylon, see http://ceylon-lang.org/download/. Ceylon 1.3.2 is required.

Step 2: Install Dart

Homebrew users on OS X can install Dart with:

$ brew tap dart-lang/dart
$ brew install dart

For Linux users, Dart is available as either a Debian package or zip download from https://www.dartlang.org/downloads/.

Step 3: Install the Ceylon/Dart CLI Plugin

The commandline interface can be installed with:

$ ceylon plugin install --force com.vasileff.ceylon.dart.cli/1.3.2-DP4

Upon using ceylon compile-dart or ceylon run-dart for the first time, you will be prompted to complete the installation by running:

$ ceylon install-dart --out +USER

This will install the Ceylon language module, several Ceylon SDK modules, and several Dart interop modules into your local Ceylon module repository, which, for default Ceylon installations, is located at ~/.ceylon/repo.

And that's it!

Please note that upon running the commandline tools the first time, additional dependencies may be downloaded. No feedback is provided that this is happening, and canceling early may result in a corrupted download. So please be patient!

Using the Commandline Interface

Commandline tools for compiling and running Ceylon programs on the Dart VM mirror the tools used for the JVM and JavaScript backends:

  • ceylon compile-dart to compile Ceylon modules to Dart
  • ceylon run-dart to run compiled Ceylon modules on the Dart VM

A third tool, ceylon assemble-dart, package a Ceylon module as a standalone executable for the Dart VM.

Ok, it's installed, what do I do now?

There are three main types of applications that can be written today:

  • command line applications,
  • web client (JavaScript) applications using dart.html, and
  • server side applications using dart.io

Support for pure-Ceylon CLI applications is quite advanced and supports nearly all valid Ceylon 1.3.2 programs. Modules can be compiled, run, and even imported using standard Ceylon tools and conventions. See the "Hello, World" walkthrough below to get started.

Check back soon for more on building server and web applications. For now, you might want to check out ColorTrompon, which is a Ceylon syntax highligher, written in Ceylon, compiled with ceylon compile-dart colortrompon, and packaged as a JavaScript application with ceylon assemble-dart mode=js colortrompon.

"Hello, World" Walkthrough

If you're new to Ceylon, you can perform the following steps to compile and run your first program.

First, use the ceylon new command to create an initial project structure:

$ ceylon new hello-world
Enter project folder name [helloworld]: 
Enter module name [com.example.helloworld]: 
Enter module version [1.0.0]: 
Would you like to generate Eclipse project files? (y/n) [y]: 
Enter Eclipse project name [com.example.helloworld]: 
Would you like to generate an ant build.xml? (y/n) [y]: 

$ cd helloworld/

In the newly created helloworld directory, you will find source/com/example/helloworld containing the main run.ceylon source code along with module.ceylon and package.ceylon module and package descriptors.

Now, from within the helloworld directory, the program can be compiled with:

$ ceylon compile-dart
Note: Created module com.example.helloworld/1.0.0

which creates a modules directory, and places the Dart output in the file modules/com/.../com.example.helloworld-1.0.0.dart

Run the program with the ceylon run command, specifying the module name and arguments:

$ ceylon run-dart com.example.helloworld 'Ceylon on Dart'
Hello, Ceylon on Dart!

Or, if you like, create a single-file application:

$ ceylon assemble-dart --out helloworld com.example.helloworld
Created executable Dart script helloworld

and run as you would any other executable:

$ ./helloworld 'Ceylon on Dart, without the Java!!'
Hello, Ceylon on Dart, without the Java!!!

Of course, you'll want to write much more sophisticated programs that take advantage of Ceylon's advanced but easy to use type system and features. To learn more, see the Ceylon language tour.

You can also try Ceylon online, but be sure to copy the examples locally, and try them out on the Dart backend!

About the ceylon new Command

Note that the ceylon new command is not Dart specific; it is a standard command available with Ceylon 1.3.2. For help using the command, use ceylon help new.

You may notice options to create Eclipse and Ant configuration files. While Eclipse and Ant support is not currently available for the Dart backend, these options may still be useful, as you might use Eclipse to develop a module using the Java or JavaScript backend, and then drop to the CLI to compile for Dart.

Also note that the first argument to ceylon new must be the name of a template. Of the three templates available as part of Ceylon 1.3.2, hello-world and simple can be used for Dart projects. For example, to get started with a blank project, you might use:

ceylon new simple --module-name=com.mydomain.myproject myprojectDir

Ceylon/Dart DP2 Release Details

SDK Modules Included in DP2

Several Ceylon SDK modules ship with DP2:

  • ceylon.buffer allows you to convert between text and binary forms of data
  • ceylon.collection provides general-purpose mutable lists, sets, and maps
  • ceylon.html allows you to write HTML templates for both server and client using only Ceylon
  • ceylon.interop.dart types and utilities to work with native Dart code and libraries,
  • ceylon.json contains everything required to parse and serialise JSON data
  • ceylon.numeric provides common math functions for floats and integers
  • ceylon.promise support for promises loosely based upon the A+ specification
  • ceylon.random provides a pseudorandom number generator and extendable API
  • ceylon.test simple framework to write repeatable tests
  • ceylon.time is a date and time library library that is loosely inspired by the JodaTime/JSR-310 library
  • ceylon.whole provides arbitrary-precision integer numeric type

Dart Interop Modules Included in DP2

Several Dart modules can be imported by DP2 programs:

  • dart.async
  • dart.collection
  • dart.convert
  • dart.core
  • dart.developer
  • dart.html
  • dart.io
  • dart.isolate
  • dart.math
  • dart.mirrors
  • dart.typed_data

License

The content of this repository is released under the ASL v2.0 as provided in the LICENSE file that accompanied this code.

By submitting a "pull request" or otherwise contributing to this repository, you agree to license your contribution under the license mentioned above.

ceylon-dart's People

Contributors

jvasileff avatar tombentley avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

ceylon-dart's Issues

don't generate redundant bridge methods

For example, a bridge C2.foo to I.foo is not needed in the code below:

interface I {
    shared default void foo() {}
}

class C1() satisfies I {}
class C2() extends C1() {}

But be careful to generate a bridge when the superclass's bridge is insufficient. Below, a bridge from C2.foo to I2.foo is required:

interface I {
    shared default void foo() {}
}

interface I2 satisfies I {
    shared actual default void foo() {}
}

class C1() satisfies I {}
class C2() extends C1() satisfies I2 {}

attempting to access static member via instance results in AssertionError

For example, using dart.html:

    value elements = querySelectorAll("#something");
    for (Element el in CeylonIterable(elements)) {
        print(el.\iATTRIBUTE_NODE);
    }

the compiler throws:

Compilation failed: AssertionError: Assertion failed: Member identifiers must be DartSimpleIdentifiers.; violated

but print(Node.\iATTRIBUTE_NODE) works.

support default implementations in native headers

native headers may provide default implementations. For example:

native class C() {
    shared String defaultMember0 => "";
    native shared String defaultMember1 => "";
    native shared String defaultMember2 => ""; 
    native shared String nonDefaultMember;
}

native("dart") class C() {
    native("dart") shared String defaultMember2 => "";
    native("dart") shared String nonDefaultMember => "";
}

and toplevels

native String s => "";

For toplevel functions and values with default implementations, backend specific implementations are optional.

For toplevel classes, objects, and interfaces with default implementations for all members, it's unclear if backend specific implementations should be required.

Default members for Inner class and interface headers appear to be valid.

Wrong comments in new run.ceylon

When I do

ceylon new simple --module-name=com.foo.bar fooBar

and then take a look at the run.ceylon, it contains comments like these:

// on the command line compile with "ceylon compile com.foo.bar" or "ant compile"
// and execute with "ceylon compile com.foo.bar/1.0.0" or "ant run"

I think they should have been like this:

// on the command line compile with "ceylon compile-dart"
// and execute with "ceylon run-dart com.foo.bar"

I have not had the chance to try ant.

error providing default argument expression for callable parameter

Both of these currently fail with an assertion error expecting f.model to be a Value in generateDefaultValueAssignments(), since the AST node type is DefaultedValueParameter | DefaultedParameterReference.

            shared void run(f = print) {
                void f(String s);
            }

            class Run(f = print) {
                void f(String s);
            }

printAll()

Given:

printAll { for (i in 0..10) i^2 };

I get:

0Unhandled exception:
type 'dart$Default' is not a subtype of type 'String' in type cast.
#0      Object._as (dart:core-patch/object_patch.dart:70)
#1      $package$printAll.<anonymous closure> (package:ceylon/language/language.dart:9655:46)
#2      Iterable.$each (package:ceylon/language/language.dart:4652:22)
#3      functionIterable$$anonymous$0_.each (package:ceylon/language/language.dart:1142:44)
#4      $package$printAll (package:ceylon/language/language.dart:9651:12)
#5      printAll (package:ceylon/language/language.dart:9662:90)
#6      $package$run.<anonymous closure> (file:///var/folders/3l/_1gb8m1n51j9_tc07h0lflr40000gn/T/ceylon-run-dart5767981372227819311/hello/hello.dart:53:16)
#7      $package$run (file:///var/folders/3l/_1gb8m1n51j9_tc07h0lflr40000gn/T/ceylon-run-dart5767981372227819311/hello/hello.dart:54:7)
#8      run (file:///var/folders/3l/_1gb8m1n51j9_tc07h0lflr40000gn/T/ceylon-run-dart5767981372227819311/hello/hello.dart:57:15)
#9      main (file:///var/folders/3l/_1gb8m1n51j9_tc07h0lflr40000gn/T/ceylon-run-dart5767981372227819311/hello/hello.dart:61:5)
#10     _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:261)
#11     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:150)

It works with plain print().

Future.then(...) doesn't like the result of uncurry

This works:

HttpClientResponse response = await (client.getUrl(url)
    .\ithen((hcr) => uncurry(HttpClientRequest.close)(hcr)));

but not:

HttpClientResponse response = await (client.getUrl(url)
    .\ithen(uncurry(HttpClientRequest.close)));
Unhandled exception:
Closure call with mismatched arguments: function 'call'

NoSuchMethodError: method not found: 'call'
Receiver: Instance of 'dart$FlatFunction'
Arguments: [Instance of '_HttpClientRequest']
#0      Object._noSuchMethod (dart:core-patch/object_patch.dart:42)
#1      Object.noSuchMethod (dart:core-patch/object_patch.dart:45)
#2      dart$FlatFunction.noSuchMethod (package:ceylon/language/language.dart:15068:25)
#3      _RootZone.runUnary (dart:async/zone.dart:1204)
#4      _FutureListener.handleValue (dart:async/future_impl.dart:131)
#5      _Future._propagateToListeners.handleValueCallback (dart:async/future_impl.dart:637)
#6      _Future._propagateToListeners (dart:async/future_impl.dart:667)
#7      _Future._completeWithValue (dart:async/future_impl.dart:477)
#8      _Future._asyncComplete.<anonymous closure> (dart:async/future_impl.dart:528)
#9      _microtaskLoop (dart:async/schedule_microtask.dart:41)
#10     _startMicrotaskLoop (dart:async/schedule_microtask.dart:50)
#11     _runPendingImmediateCallback (dart:isolate-patch/isolate_patch.dart:96)
#12     _RawReceivePortImpl._handleMessage (dart:isolate-patch/isolate_patch.dart:149)

`super.string` doesn't work inside default interface members

  • Non-formal interface members are implemented as Dart static methods that take this as the first argument.
  • Within a Ceylon interface, super.string refers to Object.string unless string is overridden by a satisfied interface.
  • Dart's Object.toString() is inaccessible in this case, since super can't be used in a static method.

This affects only super.string, since all other non-formal members that may be qualified with super within an interface will be defined by another interface, and therefore, will be implemented as Dart static methods that can be called directly.

The only fix is likely to be to intercept calls to super.string and redirect them to a static method that returns the same value as Dart's Object.toString(). That is, never really call Object.toString().

interop mapping for classes that act like interfaces

In Dart, all classes can be used as interfaces. The Ceylon translation would be:

class MyClass satisfies SomeOtherClass { ... }

which of course is not legal in Ceylon.

There seems to be no option but to have each Dart class map to two separate types: a Ceylon interface and a Ceylon class that satisfies that interface.

Either the class or interface will need a synthetic name.

Scenario 1: Use class DartClass and interface I_DartClass

  • The model loader would map parameters and returns of type DartClass to I_DartClass
  • Use of DartClass for parameter types in Ceylon code would be discouraged; I_DartClass should be used instead, for maximum flexibility.
  • The identifier DartClass would be use for instantiations and extensions in Ceylon code (e.g. DartClass() and ... extends DartClass().
  • I_DartClass would be erased to DartClass by the backend compiler.

Scenario 2: Use class C_DartClass and interface DartClass

  • Parameters and returns would be of the type DartClass.
  • Use of C_DartClass for anything other than instantiations and extensions would be discouraged.
  • C_DartClass would be erased to DartClass by the backend compiler.

Perhaps Scenario 2 is the most natural, since the synthetic name would be used less frequently, and when needed (for instantiation & extension), its use would be forced by the typechecker.

A further concern is that classes DartClass_A and DartClass_B that do not share a subtyping relationship are not guaranteed to be disjoint, which breaks Ceylon's type system. Adopting scenario 2 (which helps reduce unintentional use of the identifier that maps to the class) should help to avoid this unsoundness.

error importing ceylon.test w/o first importing ceylon.collection

module test.com.vasileff.ceylon.random.api "0.0.6-SNAPSHOT" {
    //import ceylon.collection "1.2.1";
    import ceylon.test "1.2.1";
    shared import com.vasileff.ceylon.random.api "0.0.6-SNAPSHOT";
}

Without the ceylon.collection import, the json loader fails to load the test module:

Caused by: com.redhat.ceylon.compiler.js.CompilerErrorException: Package not found: ceylon.collection
    at com.vasileff.ceylon.dart.compiler.loader.JsonPackage.getTypeFromJson(JsonPackage.java:889)
    at com.vasileff.ceylon.dart.compiler.loader.JsonPackage.loadAttribute(JsonPackage.java:562)
    at com.vasileff.ceylon.dart.compiler.loader.JsonPackage.addAttributesAndMethods(JsonPackage.java:310)
    at com.vasileff.ceylon.dart.compiler.loader.JsonPackage.loadClass(JsonPackage.java:283)
    at com.vasileff.ceylon.dart.compiler.loader.JsonPackage.loadDeclarations(JsonPackage.java:129)
    at com.vasileff.ceylon.dart.compiler.loader.JsonPackage.getTypeFromJson(JsonPackage.java:892)
    at com.vasileff.ceylon.dart.compiler.loader.JsonPackage.parseTypeList(JsonPackage.java:332)
    at com.vasileff.ceylon.dart.compiler.loader.JsonPackage.loadClass(JsonPackage.java:276)
    at com.vasileff.ceylon.dart.compiler.loader.JsonPackage.loadDeclarations(JsonPackage.java:129)
    at com.vasileff.ceylon.dart.compiler.loader.JsonModule.loadDeclarations(JsonModule.java:73)
    ... 34 more

Seems like this sort of thing was working before.

json model serialization doesn't handle ClassAliases correctly

ClassAliases, like ceylon.json::JsonObject don't have ClassAlias.extendedType or ClassAlias.constructor set correctly. After deserialization, the first is Object, and the second is null.

The raw JSON model info is:

"JsonObject":{
    "$alias":1,
    "an":{"doc":["Alternative name for [[Object]] which avoids collision with\nceylon.language::Object."]},
    "mt":"c","nm":"JsonObject","pa":1,
    "ps":[{"$t":{"md":"$","nm":"Iterable","pk":"$","ta":{"Iterable.Absent":{"md":"$","nm":"Null","pk":"$"},"Iterable.Element":{"md":"$","nm":"Entry","pk":"$","ta":{"Entry.Item":{"nm":"Value","pk":"."},"Entry.Key":{"md":"$","nm":"String","pk":"$"}}}}},"mt":"prm","nm":"values"}],
    "super":{"nm":"Object","pk":"."}}

and a test program generating an error is:

JsonObject o = JsonObject { "key"->"value" };
Assertion failed
        violated is ClassModel | ConstructorModel resolved
            =   constructor.constructor
ceylon.language.AssertionError "Assertion failed
        violated is ClassModel | ConstructorModel resolved
            =   constructor.constructor"
        at com.vasileff.ceylon.dart.compiler.core.resolveClassAliases_.resolveClassAliases(functions.ceylon:519)
        at com.vasileff.ceylon.dart.compiler.core.computeCaptures_$1captureVisitor_.captureForClass$priv$(computeCaptures.ceylon:205)
        at com.vasileff.ceylon.dart.compiler.core.computeCaptures_$1captureVisitor_.visitBaseExpression(computeCaptures.ceylon:181)

support expressions with type Nothing in string templates

This:

noop("``nothing``");

currently fails to compile as an attempt is made to find a member named "string" in the type Nothing. Instead, we should treat the instance as Anything, and use Object.string if not null, or "<null>" if Null.

runtime error w/class function argument w/split declaration

Surely this used to work?

class X(fun) {
    shared String fun(String s);
}

this does work:

class X(shared String fun(String s)) {}

The first compiles to:

class X implements $ceylon$language.dart$$Basic {
  X([$ceylon$language.Callable fun]) {
    this._fun$c = fun;
  }
}

and the second:

class X implements $ceylon$language.dart$$Basic {
  X([$ceylon$language.Callable fun]) {
    this._fun$c = fun;
  }
  $ceylon$language.Callable _fun$c;
  $dart$core.String fun([$dart$core.String s]) {
    return $ceylon$language.$dartString(_fun$c.f($ceylon$language.$ceylonString(s)));
  }
}

So generation of _fun$c and fun is not being triggered in the split declaration case.

perform 'late' value initialization non-polymorphically, *sometimes*

The most reasonable (edit: or not... see below) output for the code below is what the JVM produces, where the assignment to a late value is non-polymorphic unless the value has a late or variable refinement.

I'm guessing the JVM behavior is a natural result of setX() refinements existing for j and k, but not i.

class A() {
    shared default late Integer i;
    shared default late Integer j;
    shared default late Integer k;

    shared void initialize(Integer x) {
        i = x;
        j = x;
        k = x;
    }
}

class B() extends A() {
    shared actual Integer i = 1;
    shared actual variable Integer j = 1;
    shared actual late Integer k;
}

shared void runit() {
    value b = B();
    b.initialize(2);
    printAll { b.i, b.j, b.k };
    // {1, 2, 2}      on JVM
    // {1, 1, Crash!} on JS
    // {2, 2, 2}      on Dart
}

OTOH, @gavinking, should each of these be allowed?

perform required initialization checks on `late` declarations

For the implementation, we could do one of the following:

  1. use a late indicator value (analogous to dartDefault) for uninitialized values, or
  2. do what the Java backend does: use null as the indicator value for non-optionals, and a separate Boolean for optionals.

For the first, we'd have to use Object as the type for the underlying value and add casts in exposed getters and setters, but that should be fine.

work around naming conflicts for private class members

Dart "private" members of classes are polymorphic, at least within the same package. Ceylon non-shared members are not; a private member may shadow, but not override a super class member of the same name.

So we need some way to distinguish Super.x from Sub.x. The easiest (only?) approach may be to use globally (or at least module-wide) unique names for private members. This isn't a problem for interfaces since static invocation is always used for non-shared interface members.

The code below currently prints "B B" rather than "A B":

shared void run() {
    class A() {
        String id => "A";
        shared String idA => id;
    }
    class B() extends A() {
        String id => "B";
        shared String idB => id;
    }
    print(B().idA); // should print "A"
    print(B().idB); // should print "B"
}

the problem can also occur with outer in a recursive member class:

shared void run() {
    class C() {
        String id => "C";
        shared class D() extends C() {
            String id => nothing;
            shared String outerId => outer.id;
        }
    }
    print(C().D().D().outerId); // should print "C", not crash on `nothing`
}

or on invocation of a static reference:

shared void run() {
    class E() {
        String id => "E";
        shared class F() extends E() {
            String id => nothing;
            shared String eId => E.id(this);
        }
    }
    print(E().F().eId); // should print "E", not crash on `nothing`
}

shadowing previously used declaration w/assert fails

Ceylon allows new value definitions in assert to shadow declarations made in outer scopes, even if the declaration has already been used in the same block containing the assert. Java allows similar, but Dart doesn't.

This fails at runtime:

class B() {
    shared variable Integer x = 10;
}
class C() extends B() {
    shared void f() {
        print(x); // 10
        assert(is Integer x = 20 of Anything);
        print(x); // 20
    }
}

#12 is similar.

consider hard-coding generic type info for `dart.async::Future.then`

Future.then (docs) is defined as:

Future/*<S>*/ then/*<S>*/(/*=S*/ onValue(T value), { Function onError });

which results in the return type Future<Nothing> in Ceylon. Instead, we should consider hard-coding the model to have something like:

Future<S> then<S>(S|Future<S> onValue(T value), ...);

although, it may need to be more complicated, like:

Future<S|E|Throwable> then<S,E=Nothing>(S|Future<S> onValue(T value), E onError(Nothing) = nothing)

which starts to defeat the purpose. Especially since non-Throwables can be thrown in Dart. So, would we actually wind up with a return type of Future<Anything>?

Edit: not sure why I had Throwable in the union. Need to test this. It might be:

Future<S|E> then<S,E=Nothing>(S|Future<S> onValue(T value), E onError(Nothing) = nothing)

try making Dart's dynamic type map to Anything

Dart dynamic is currently mapped to:

  • Nothing for return types
  • Anything for parameter types
  • Nothing for type arguments (since generics in Dart are always covariant)

The idea was to be permissive, and somewhat match Java's pre-generics type safety.

But, this is probably too permissive. So let's try making dynamic always map to Anything, and see if the asserts are manageable.

See also 234ef05

make fake static Class members non-generic

In #8, each Dart type turns into a Ceylon interface and a static member class named Class. For generic Dart types, both the Ceylon interface and static class currently have type parameters. But, since in Ceylon, qualifying type type parameters are in scope for static members, the Class's type parameters are redundant and should be removed.

add nonempty check; don't trust Iterables

For most non-empty iterable-to-sequence operations where the iterable is not actually empty, there is a class cast exception. But this one trips up the Dart backend:

    object lyingIterable satisfies {Integer+} {
        iterator() => emptyIterator;
    }
    Integer x = [1, *lyingIterable][1];
    print(x); // <null>

It may be best to explicitly check all spread arguments involving non-empty Iterables.

support import of top-level object members

Per §4.2.2, this should work:

import ceylon.language {
    true {
        string
    }
}

shared void run() {
    print(string);
}

print(string) currently compiles to:

$ceylon$language.print($ceylon$language.String.instance(toString()));

but should be:

$ceylon$language.print($ceylon$language.String.instance($ceylon$language.$true.toString()));

don't prefix unshared class initializer parameters with "_$"

Currently makePrivate() prepends _$ to avoid conflicts with Ceylon identifiers that already begin with _. Instead, we should:

  1. Not use makePrivate() on class initializer parameters, and
  2. Prefix Ceylon parameters that begin with _ with $, since Dart parameters should begin with _.

Test case:

shared class AvoidNonUniqueNames(String myString, shared String _myString) {}

local types with same name and ancestry have conflicting names

Classes and interfaces with the same ancestry and name need to be disambiguated:

shared void run() {
    if (1==1) {
        interface I {}
        class C() satisfies I {}
    }
    else {
        interface I {} // compiles to same name as previous interface I
        class C() satisfies I {} // compiles to same name as previous class C
    }
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.