jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
Signup
Boo
  • Boo
  • BOO-448

Generics

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: New Feature New Feature
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: Compiler, Emitter, Parser, Type System
  • Labels:
    None
  • Number of attachments :
    1

Description

Being able to consume Generics is required for any CLS-compliant .NET 2.0 language.

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Text File
    BOO-448-2.patch
    27/Oct/06 11:53 AM
    451 kB
    Avishay Lavie

Issue Links

depends upon

New Feature - A new feature of the product, which has yet to be developed. BOO-763 Defining new generic types

  • Major - Major loss of function.
  • In Progress - This issue is being actively worked on at the moment by the assignee.

New Feature - A new feature of the product, which has yet to be developed. BOO-832 Defining new generic methods

  • Major - Major loss of function.
  • In Progress - This issue is being actively worked on at the moment by the assignee.

Improvement - An improvement or enhancement to an existing feature or task. BOO-759 Invalid IL for generator methods whose yield type is a generic parameter

  • Major - Major loss of function.
  • Reopened - This issue was once resolved, but the resolution was deemed incorrect. From here issues are either marked assigned or resolved.

Improvement - An improvement or enhancement to an existing feature or task. BOO-758 Generic instance for internal types

  • Major - Major loss of function.
  • Resolved - A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.

Improvement - An improvement or enhancement to an existing feature or task. BOO-760 Generic callable instantiation

  • Major - Major loss of function.
  • Resolved - A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.

Improvement - An improvement or enhancement to an existing feature or task. BOO-761 Implementing generic interfaces

  • Major - Major loss of function.
  • Resolved - A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.

Improvement - An improvement or enhancement to an existing feature or task. BOO-762 overriding generic members

  • Major - Major loss of function.
  • Resolved - A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.

Improvement - An improvement or enhancement to an existing feature or task. BOO-777 Consuming generic methods

  • Major - Major loss of function.
  • Resolved - A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.

Improvement - An improvement or enhancement to an existing feature or task. BOO-820 Honor generic parameter constraints when constructing generic types

  • Minor - Minor loss of function, or other problem where easy workaround is present.
  • Resolved - A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.

Improvement - An improvement or enhancement to an existing feature or task. BOO-755 Type inference for IEnumerable of T

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Improvement - An improvement or enhancement to an existing feature or task. BOO-756 Extending generic types

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Improvement - An improvement or enhancement to an existing feature or task. BOO-757 Generic type references and generic type reference expressions

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.
is depended upon by

New Feature - A new feature of the product, which has yet to be developed. BOO-447 Addin for SharpDevelop 2.0

  • Critical - Crashes, loss of data, severe memory leak.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.
is related to

Improvement - An improvement or enhancement to an existing feature or task. BOO-803 Generic list and hash builtins

  • Minor - Minor loss of function, or other problem where easy workaround is present.
  • Open - The issue is open and ready for the assignee to start work on it.
Show 9 more links (7 depends upon, 1 is depended upon by, 1 is related to)

Activity

Ascending order - Click to sort in descending order
  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Avishay Lavie added a comment - 16/Sep/06 9:44 AM

I've done some work on point #2 from here: http://groups.google.com/group/boolang/msg/4c49391b6778330f
The attached patch allows for type inference in for-loops over types that implement IEnumerable<T>:

ints = List<int>
ints.Add(21)
for i in ints:
print i * 2

In addition, the patch also allows classes to inherit from constructed generic types, to allow the following:

class MyList(List of int):
pass

ints = MyList()
ints.Add(21)
for i in ints:
print i * 2

The patch defines a new interface, IGenericType, that represents a constructed (or partially constructed) generic type; and a new class, ExternalGenericType, that implements the interface for external constructed generics.

This is my first patch for Boo, so I'd really like to hear your comments (coding style, bugs, etc.)

Show
Avishay Lavie added a comment - 16/Sep/06 9:44 AM I've done some work on point #2 from here: http://groups.google.com/group/boolang/msg/4c49391b6778330f The attached patch allows for type inference in for-loops over types that implement IEnumerable<T>: ints = List<int> ints.Add(21) for i in ints: print i * 2 In addition, the patch also allows classes to inherit from constructed generic types, to allow the following: class MyList(List of int): pass ints = MyList() ints.Add(21) for i in ints: print i * 2 The patch defines a new interface, IGenericType, that represents a constructed (or partially constructed) generic type; and a new class, ExternalGenericType, that implements the interface for external constructed generics. This is my first patch for Boo, so I'd really like to hear your comments (coding style, bugs, etc.)
Hide
Permalink
Avishay Lavie added a comment - 16/Sep/06 9:55 AM
  • IEnumerable<T> type inference in for-loops
  • Correct binding when subclassing constructed generic types
Show
Avishay Lavie added a comment - 16/Sep/06 9:55 AM IEnumerable<T> type inference in for-loops Correct binding when subclassing constructed generic types
Hide
Permalink
Avishay Lavie added a comment - 16/Sep/06 10:11 AM

Added testcases.

Show
Avishay Lavie added a comment - 16/Sep/06 10:11 AM Added testcases.
Hide
Permalink
Avishay Lavie added a comment - 27/Oct/06 11:53 AM

Attached BOO-448-2.patch –
+ Resolves BOO-758, BOO-760, BOO-761 and BOO-762.
+ Adds testcases for above issues and for BOO-763 (generic generators, which aren't yet supported).

Show
Avishay Lavie added a comment - 27/Oct/06 11:53 AM Attached BOO-448 -2.patch – + Resolves BOO-758 , BOO-760 , BOO-761 and BOO-762 . + Adds testcases for above issues and for BOO-763 (generic generators, which aren't yet supported).
Hide
Permalink
Rodrigo B. de Oliveira added a comment - 27/Oct/06 12:44 PM

Thanks for the patch, Avishay! I'm working on it right now.

In the future, please make sure all of the existing tests pass with your patch applied (I know there were already 2 broken tests in our suite before so I apologize for the confusion).

Please also try to submit broken test cases as separate attachments as it's not desirable to keep failing test cases in the code base - unless we create a specific test suite for broken test cases which would make the point clear. Thoughts?

Thanks again!

Show
Rodrigo B. de Oliveira added a comment - 27/Oct/06 12:44 PM Thanks for the patch, Avishay! I'm working on it right now. In the future, please make sure all of the existing tests pass with your patch applied (I know there were already 2 broken tests in our suite before so I apologize for the confusion). Please also try to submit broken test cases as separate attachments as it's not desirable to keep failing test cases in the code base - unless we create a specific test suite for broken test cases which would make the point clear. Thoughts? Thanks again!
Hide
Permalink
Avishay Lavie added a comment - 27/Oct/06 1:08 PM

Yes, I was sloppy with testing before committing. I apologize.
Does the patch break anything?
Also, Is there a quick and easy way to run all of the unit tests? (I'm using Windows with SharpDevelop 2.1)

Show
Avishay Lavie added a comment - 27/Oct/06 1:08 PM Yes, I was sloppy with testing before committing. I apologize. Does the patch break anything? Also, Is there a quick and easy way to run all of the unit tests? (I'm using Windows with SharpDevelop 2.1)
Hide
Permalink
Rodrigo B. de Oliveira added a comment - 27/Oct/06 1:18 PM

The patch broke a very simple issue with the way generic types were presented in error messages.

I always use 'nant test' but make sure peverify is on your path. If it isn't, define the peverify environment variable with a value of false.

By the way, the code is in. Great work!

Show
Rodrigo B. de Oliveira added a comment - 27/Oct/06 1:18 PM The patch broke a very simple issue with the way generic types were presented in error messages. I always use 'nant test' but make sure peverify is on your path. If it isn't, define the peverify environment variable with a value of false. By the way, the code is in. Great work!

People

  • Assignee:
    Rodrigo B. de Oliveira
    Reporter:
    Daniel Grunwald
Vote (4)
Watch (4)

Dates

  • Created:
    18/Aug/05 1:43 PM
    Updated:
    26/May/07 4:07 PM
  • Atlassian JIRA (v5.2.7#850-sha1:b2af0c8)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.