Preheat the oven to 200 degrees C. Grease a large baking dish lightly with olive oil or cooking spray.
Cut the pumpkin into pieces then seed and cut the peel off. Cut into small cubes (about 1-2 cm) and put them in the large baking dish. Chop the onion into large chunks and spread also over the baking dish. Drizzle with olive oil and sprinkle with salt and pepper. Cook for 35-40 minutes in the middle of the preheated oven until cooked.
When the pumpkin has 10 minutes to cook place a saucepan with water and some salt on to heat. Cook the pasta according to the instructions on the package until al dente. Drain, reserving the cooking liquid (at least 250ml).
Remove the baking dish with pumpkin and onion from the oven and let it stand.
Chop the walnuts or pecans coarsely and toast them in a frypan without oil on medium heat for a few minutes. Make sure they do not burn.
On a large serving dish or in a bowl crumble the goat's cheese. Add the hot pasta and stir well until the cheese has melted. Add cooking liquid, until you get a creamy sauce.
Add the pumpkin, onion, walnuts and basil to the pasta then stir well. Season with salt and pepper. Serve with Parmesan cheese.