
|
If you were logged in you would be able to see more operations.
|
|
|
Boo
Created: 23/Oct/05 08:49 PM
Updated: 21/Nov/05 09:36 AM
|
|
| Component/s: |
Compiler
|
| Affects Version/s: |
None
|
| Fix Version/s: |
0.7.5
|
|
in C#, this is legal:
int i = new int();
whereas in Boo,
i as int = int()
ERROR: The type 'System.Int32' does not have a visible constructor that matches the argument list '()'.
the blank constructor should create a new instance, even though it is impossible to define a blank constructor in a ValueType, it would be handy for instances like this:
Length(Feet: 5.0)
which would create a new Length, then assign Feet to 5.0, without having to go through an intermediary constructor.
|
|
Description
|
in C#, this is legal:
int i = new int();
whereas in Boo,
i as int = int()
ERROR: The type 'System.Int32' does not have a visible constructor that matches the argument list '()'.
the blank constructor should create a new instance, even though it is impossible to define a blank constructor in a ValueType, it would be handy for instances like this:
Length(Feet: 5.0)
which would create a new Length, then assign Feet to 5.0, without having to go through an intermediary constructor. |
Show » |
|
That's syntax sugar.
int i = new int(); is the same as int i = 0;
jsut do length.Feet = 5.0 directly.