Methods for inhibiting a ROS1 kinase with compounds of FormulaI:and pharmaceutically acceptable salts thereof, wherein ring A, ring B, W, m, D, R2, R2a, R3, R3a, and Z are as defined herein. The compounds and methods provided herein are useful in the treatment of cancer (e.g., ROS1-associated cancers as defined herein).本發明係關於使用式I化合物及其醫藥上可接受之鹽抑制ROS1激酶之方法,其中環A、環B、W、m、D、R2、R2a、R3、R3a及Z係如本文所定義。本文所提供之該等化合物及方法可用於治療癌症(例如如本文所定義之ROS1相關癌症)。