Skip to content

Instantly share code, notes, and snippets.

Created February 19, 2018 18:34
Show Gist options
  • Save anonymous/7a790b404c6e1c92ef5818f6b0c3ca64 to your computer and use it in GitHub Desktop.
Save anonymous/7a790b404c6e1c92ef5818f6b0c3ca64 to your computer and use it in GitHub Desktop.
import strutils
type
RouteTypes = enum
routesLocal
Route = tuple[routeType: RouteTypes, path: string]
var
s = ""
route: Route = (routesLocal, "foo")
# This is wrong BUT the Error message seems wrong to?!
s.add "$# $#" % [route.routeType, route.path]
# s.add "$# $#" % [$route.routeType, route.path]
# I see the error
## bug.nim(12, 40) Error: type mismatch: got <string> but expected 'RouteTypes = enum'
# but should it not be?:
## bug.nim(12, 40) Error: type mismatch: got <RouteTypes = enum> but expected 'string'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment