Araq/Nimrod — Issue #89: Sort algorithm fails to compile
Author: Tass
Created: 2012-01-17 15:03:29+00:00
State: open

Code to reproduce:

import algorithm

type
TShip = object
initiative: int
TShips = seq[TShip]

proc cmp(x,y: TShip): int = result = cmp(x.initiative, y.initiative)
proc sort(ships: var TShips) = sort(ships, cmp, Descending)

Errors from gcc:

bug.c: In function ‘Sort_55024’:
bug.c:107:23: error: request for member ‘data’ in something not a structure or union
bug.c:107:42: error: request for member ‘Sup’ in something not a structure or union