Skip to content

Commit

Permalink
Test original snippet from nim-lang#15241
Browse files Browse the repository at this point in the history
  • Loading branch information
Clyybber committed Sep 18, 2020
1 parent 2671efa commit ed299b5
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion tests/overload/toverload_various.nim
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@ block:

block:
type
TilesetCT[n: static[int]] = distinct int
TilesetCT[n: static int] = int
TilesetRT = int
Tileset = TilesetCT | TilesetRT

Expand All @@ -482,6 +482,20 @@ block:
var parsedTileset: TilesetRT
prepareTileset(parsedTileset)

block:
type
TilesetCT[n: static int] = distinct int
TilesetRT = int
Tileset = TilesetCT | TilesetRT

func prepareTileset(tileset: var Tileset) = discard

func prepareTileset(tileset: Tileset): Tileset =
result = tileset
result.prepareTileset

var parsedTileset: TilesetRT
prepareTileset(parsedTileset)

block:
proc p1[T,U: SomeInteger|SomeFloat](x: T, y: U): int|float =
Expand Down

0 comments on commit ed299b5

Please sign in to comment.