Boo

Current Generic support breaks name resolution

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 0.7.6
  • Fix Version/s: 0.7.7
  • Component/s: Compiler
  • Labels:
    None
  • Environment:
    boo-0.7.6.2299, .net 2.0
  • Number of attachments :
    0

Description

The following code:

foo.boo
import System.Collections
import System.Collections.Generic

def foo() as IEnumerable:
  yield 1
  yield 2
  yield 3

Reports BCE0004: Ambiguous reference 'IEnumerable': System.Collections.IEnumerable, System.Collections.Generic.IEnumerable.

Activity

Hide
Avishay Lavie added a comment -

We need some different syntax to reference generic type definitions. C# has IEnumerable<> and IDictionary<,>, which is kinda ugly but distinguishes them from the non-generic IEnumerable and IDictionary. We need something similar so that a name without generic arguments will never be interpreted as a generic definition.

Show
Avishay Lavie added a comment - We need some different syntax to reference generic type definitions. C# has IEnumerable<> and IDictionary<,>, which is kinda ugly but distinguishes them from the non-generic IEnumerable and IDictionary. We need something similar so that a name without generic arguments will never be interpreted as a generic definition.
Hide
Avishay Lavie added a comment -

This is becoming more and more bug-prone. I'd like to take over this issue. Is it OK with you, bamboo?

Show
Avishay Lavie added a comment - This is becoming more and more bug-prone. I'd like to take over this issue. Is it OK with you, bamboo?
Hide
Rodrigo B. de Oliveira added a comment -

Thanks Avish.

Show
Rodrigo B. de Oliveira added a comment - Thanks Avish.
Hide
Avishay Lavie added a comment -

Resolved in 2447.
References containing generic parameters only match generic types, and references that don't only match non-generic types. To reference a generic type definition, the "Type of *" or "Type[of *, *]" syntax can be used.

Show
Avishay Lavie added a comment - Resolved in 2447. References containing generic parameters only match generic types, and references that don't only match non-generic types. To reference a generic type definition, the "Type of *" or "Type[of *, *]" syntax can be used.

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: