A compound of formula: wherein R 1 is 9- or 10-membered bicyclic heteroaryl wherein the 9- or 10-membered bicyclic heteroaryl contains from one to three heteroatoms independently selected from oxygen and nitrogen and is optionally substituted by C 1-6 alkyl, C 3-6 cycloalkyl, halo, -CN or - NHSO 2 R 5, or pyridinyl optionally substituted by one or two substituents independently selected from C 1-6 alkyl, -OR 6, halo and -NHSO 2 R 7; X is -CH 2 NR 2 R 3, C 1-6 alkyl, -CH 2 phenyl, -(CH 2) n OR 10, -CH 2 SO 2 R 11 or -(CH 2) p C 3-6 cycloalkyl; R 2 and R 3, together with the nitrogen atom to which they are attached, are linked to form a 6- or 7-membered heterocyclyl or a 9- or 10-membered bicyclic heterocyclyl wherein the 6- or 7-membered heterocyclyl or the 9- or 10-membered bicyclic heterocyclyl optionally contains an oxygen atom, a sulphur atom or a further nitrogen atom and is optionally substituted by from one to three substituents independently selected from oxo, C 1-6 alkyl, - (CH 2) m NR 8 R 9, phenyl optionally substituted by halo, and 6-membered heteroaryl wherein the 6-membered heteroaryl contains one or two nitrogen atoms, a 7-membered bridged heterocyclyl wherein the 7-membered bridged heterocyclyl optionally contains a further nitrogen atom and is optionally substituted by from one to three substituents independently selected from C 1-6 alkyl, or a 10-membered spiro bicyclic heterocyclyl wherein the 10-membered spiro bicyclic heterocyclyl optionally contains an oxygen atom, or R 2 is hydrogen and R 3 is C 1-6 alkyl optionally substituted by one or two substituents independently selected from -OR 12 and -NR 13 R 14; R 4 is hydrogen or methyl; R 6, R 12 and R 15 are each independently hydrogen or C 1-4 alkyl; R 5 and R 7 are each independently C 1-6 alkyl or phenyl wherein the phenyl is optionally substituted by one or two substituents independently selected from halo and -OR 15; R 8 and R 9, together with the nitrogen atom to which they are attached, are linked to form a 5- or 6-membered heterocyclyl optionally containing an oxygen atom; R 10 is hydrogen, C 1-6 alkyl, -(CH 2) q phenyl or C 3-6 cycloalkyl wherein the C 3-6 cycloalkyl is optionally substituted by one or two substituents independently selected from C 1-6 alkyl; R 11 is C 1-6 alkyl or phenyl; R 13 and R 14, together with the nitrogen atom to which they are attached, are linked to form a 6-membered heterocyclyl optionally containing an oxygen atom; m, p and q are each independently 0, 1 or 2; and n is 1 or 2; or a salt thereof. R 1 is 9- or 10-membered bicyclic heteroaryl wherein the 9- or 10-membered bicyclic heteroaryl contains from one to three heteroatoms independently selected from oxygen and nitrogen and is optionally substituted by C 1-6 alkyl, C 3-6 cycloalkyl, halo, -CN or - NHSO 2 R 5, or pyridinyl optionally substituted by one or two substituents independently selected from C 1-6 alkyl, -OR 6, halo and -NHSO 2 R 7; X is -CH 2 NR 2 R 3, C 1-6 alkyl, -CH 2 phenyl, -(CH 2) n OR 10, -CH 2 SO 2 R 11 or -(CH 2) p C 3-6 cycloalkyl; R 2 and R 3, together with the nitrogen atom to which they are attached, are linked to form a 6- or 7-membered heterocyclyl or a 9- or 10-membered bicyclic heterocyclyl wherein the 6- or 7-membered heterocyclyl or the 9- or 10-membered bicyclic heterocyclyl optionally contains an oxygen atom, a sulphur atom or a further nitrogen atom and is optionally substituted by from one to three substituents independently selected from oxo, C 1-6 alkyl, - (CH 2) m NR 8 R 9, phenyl optionally substituted by halo, and 6-membered heteroaryl wherein the 6-membered heteroaryl contains one or two nitrogen atoms, a 7-membered bridged heterocyclyl wherein the 7-membered bridged heterocyclyl optionally contains a further nitrogen atom and is optionally substituted by from one to three substituents independently selected from C 1-6 alkyl, or a 10-membered spiro bicyclic heterocyclyl wherein the 10-membered spiro bicyclic heterocyclyl optionally contains an oxygen atom, or R 2 is hydrogen and R 3 is C 1-6 alkyl optionally substituted by one or two substituents independently selected from -OR 12 and -NR 13 R 14; R 4 is hydrogen or methyl; R 6, R 12 and R 15 are each independently hydrogen or C 1-4 alkyl; R 5 and R 7 are each independently C 1-6 alkyl or phenyl wherein the phenyl is optionally substituted by one or two substituents independently selected from halo and -OR 15; R 8 and R 9, together with the nitrogen atom to which they are attached, are linked to form a 5- or 6-membered heterocyclyl optionally containing an oxygen atom; R 10 is hydrogen, C 1-6 alkyl, -(CH 2) q phenyl or C 3-6 cycloalkyl wherein the C 3-6 cycloalkyl is optionally substituted by one or two substituents independently selected from C 1-6 alkyl; R 11 is C 1-6 alkyl or phenyl; R 13 and R 14, together with the nitrogen atom to which they are attached, are linked to form a 6-membered heterocyclyl optionally containing an oxygen atom; m, p and q are each independently 0, 1 or 2; and n is 1 or 2; or a salt thereof.