Halogenated quinolines in position 2,4 very easily undergo nucleophilic substitution reactions. For its part, isoquinoline can only give this reaction in position 1. All nucleophiles with the capacity to give S N 2 can participate in this reaction, bad nucleophiles such as water or alcohols require heat input.
Position 2 is slightly less reactive than position 4 due to hindrance from the nitrogen lone pair.
The mechanism of this reaction takes place through addition-elimination stages.
After the nucleophilic attack it is essential that a stable intermediate is formed in which the negative charge rests on the nitrogen atom.