Issue Details (XML | Word | Printable)

Key: BOO-1089
Type: Improvement Improvement
Status: Resolved Resolved
Resolution: Fixed
Priority: Minor Minor
Assignee: Cedric Vivier
Reporter: Cedric Vivier
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
Boo

Avoid unneeded field initialization

Created: 23/Oct/08 07:56 AM   Updated: 13/Jan/09 05:42 AM   Resolved: 13/Jan/09 05:42 AM
Return to search
Component/s: None
Affects Version/s: 0.8.2
Fix Version/s: 0.9

Time Tracking:
Not Specified


 Description  « Hide

Currently, field initialization generates unneeded code when using default values.

The following code :

class Foo:
    _enabled = false
    _count = 0

Will create and emit these as assignment in the constructor.
Of course one could define fields with _enabled as bool and _count as int to avoid that, but it is not what type inference is about and Boo should be smart enough to handle that automatically.



Cedric Vivier added a comment - 13/Jan/09 05:42 AM

Fixed in rev. 3098