use nil-terminated list when resolving types