Check references at compile time