Heat oven to 400° F.
Cook the pasta according to the package directions. Reserve ¾ cup of the cooking water, drain the pasta, and return it to the pot.
Meanwhile, on a rimmed baking sheet, toss the broccoli, walnuts, oil, garlic, ½ teaspoon salt, and ¼ teaspoon pepper.
Roast, tossing once, until the broccoli is tender, 18 to 20 minutes.
Toss the pasta with the broccoli mixture, butter, and ½ cup of the reserved pasta water. (Add more water if the pasta seems dry.)
Sprinkle with the Parmesan before serving.