ceylon/ceylon-compiler — Issue #216: Same name for Ctor params and simple attr
Author: alexanderbell
Created: 2011-11-23 07:38:03+00:00
State: open

I've got a model class Employee:

```ceylon
shared class Employee(String firstname, String lastname) {
shared String firstname = firstname;
shared String lastname = lastname;
shared String fullname = "Employee " lastname ", " firstname "";
}
```

I wanna use that model class in the following way:

```ceylon
void run() {
Employee e = Employee("Alex", "Bell");
print(e.firstname);
}
```

Eclipse shows no compile errors. Unfortunately the code doesn't run (NoClassDefFound). When I have a look at the ceylon archive (default_module-unversioned.car) the archive contains only empty directories. So probably a compile error.

When I change the simple attribute names it works:

```ceylon
shared class Employee(String firstname, String lastname) {
shared String myfirstname = firstname;
shared String mylastname = lastname;
shared String fullname = "Employee " lastname ", " firstname "";
}
```

```ceylon
void run() {
Employee e = Employee("Alex", "Bell");
print(e.myfirstname);
}
```

cheers Alex