Skip to content

Instantly share code, notes, and snippets.

@capocasa
Created March 6, 2018 20:44
Show Gist options
  • Save capocasa/756990d8d16cea943081cc0432f31b99 to your computer and use it in GitHub Desktop.
Save capocasa/756990d8d16cea943081cc0432f31b99 to your computer and use it in GitHub Desktop.
echo "
import system
type Bar[T] = ref object
value: T
type types = int32|int64 # if I change this to just int32 or int64 it works (compiles)
# if I replace Bar everywhere with seq it also compiles fine
proc Foo[T: Bar[types]](): T =
when T is Bar: nil
discard Foo[Bar[int32]]()
" > a.nim
nim c a.nim
SIGSEGV: Illegal storage access. (Attempt to read from nil?)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment