-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Closed
Copy link
Labels
Description
The converter for type class matching (enums ) works unexpectedly with procs having more than one argument of the converted type (?)
Current Output
type
IdLayer {.pure, size: int.sizeof.} = enum
Core
Ui
IdScene {.pure, size: int.sizeof.} = enum
Game
Shop
SomeIds = IdLayer|IdScene
converter toint*(x: SomeIds): int = x.int
var IdGame : int = IdScene.Game #works
## method that get ints
bind_scene(Core,Game) # doesn't work, type mismatch for Game, doesnt convert to int
bind_scene(Core,IdScene.Game) # doesn't work, type mismatch for Game, doesnt convert to int
bind_scene(Core,IdGame) # works Expected Output
type
IdLayer {.pure, size: int.sizeof.} = enum
Core
Ui
IdScene {.pure, size: int.sizeof.} = enum
Game
Shop
SomeIds = IdLayer|IdScene
converter toint*(x: SomeIds): int = x.int
## method that gets ints
bind_scene(Core, Game) Additional Information
$ nim -v
Nim Compiler Version 1.0.6
Nim Compiler Version 1.2.0 ( devel )