[BLUEJ-630] Add structured type slots
I had always intended that Stride would eventually feature structured type slots (similar to expression slots), so that ArrayList had the angle brackets as a fixed pair like brackets in expression slots, and ArrayList as a different text field to Integer. Similarly, comma would make separate slots and square brackets would always come as a pair.
For Greenfoot this was less urgent, but for BlueJ I think it's time to do this. The only drawback I see (apart from implementation effort) is that it makes types in expression slots (e.g. casting) act differently from types in type slots, because < will be angle bracket in type slot, but less-than operator in expression slot, even in a cast.
We will also need to decide if we use the existing expression slot class, by adding a type mode or factoring out common aspects, or whether we duplicate it and chop. The latter might be better and less likely to cause issues with existing working functionality.
Addendum: we have decided to do this. (Also: I wonder if merging with expression slot is best after all.) For now, super/extends will be omitted. Only allowable items are identifiers, question mark, angle brackets, dots, square brackets.
Also, we should encourage/add the diamond operator in "new ArrayList", and if possible, make its absence an error.
Issue metadata
- Issue type: Sub-task
- Priority: Medium
- Parent issue: [BLUEJ-622] Add Stride support to BlueJ
- Fix versions: 4.0.0preview