History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: BOO-853
Type: Sub-task Sub-task
Status: Open Open
Priority: Major Major
Assignee: Avishay Lavie
Reporter: Avishay Lavie
Votes: 0
Watchers: 0
Operations

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

Internal Generic Types: Correct handling of nested types inside generic types

Created: 03/Aug/07 04:42 PM   Updated: 06/Jun/08 02:45 PM
Component/s: None
Affects Version/s: None
Fix Version/s: 0.9

Time Tracking:
Not Specified

Issue Links:
Related
 


 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Avishay Lavie - 04/Jan/08 04:16 PM
This affects several places. Suppose we have the following:
public class Outer[of T]:
  public class Inner[of U]:
      pass

instance as Outer[of int].Inner[of string]

1. Parsing: The parser cannot even handle typereferences for this kind of things. The type reference "Outer[of int].Inner[of string]" cannot be correctly represented in the current AST model (it can be represented a a generic reference expression inside a method, but not as a type reference). The parser errors out on it.

2. Binding: What should Outer[of int].Inner be bound to? It can't be bound to the generic type definition Outer[of T].Inner, because then we'd lose the int type argument. It can't be bound to any constructed type because it's missing its second type argument. Do we need another transient IType implementation for half-constructed generic definitions?

3. Emitting: While Outer[of T].Inner[of U] is considered to have a generity of 1, it needs to be emitted as having a generity of 2: Outer`1.Inner`1<T, U>. The same goes for things like the non-generic nested type List[of T].Enumerator, which should actually be emitted as the generic type definition List`1.Enumerator<T>.