Sockeye: implement reference check inside node declarations