The second parameter of your addSpellToClassSpellList function is
addSpellLink.
In the Incomming test, you're printing
spellLink which will always be nil unless it's defined elsewhere.
Code:
print("test function incoming", addClassSpellList, addSpellLink)