Toast the filling. Preheat oven to 350. Spread coconut on one side of a large rimmed baking sheet, and pecans on other side, keeping them separate. Toast until fragrant, 15 to 20 minutes, stirring occasionally.
Meanwhile, line an 8-inch square pan with a strip of waxed paper (leaving an overhang on two sides). Spray paper with nonstick cooking spray or grease with butter.
Assemble bars. In a large nonstick pot over medium-low, heat marshmallows and butter until melted, 5 to 10 minutes, stirring frequently. Stir in cornflakes, toasted coconut, toasted pecans, and chocolate. Transfer to prepared pan; press in firmly with a metal spatula (coated with cooking spray or butter to prevent sticking).
Cool and serve. Cool until firm, about 2 hours. Remove from pan; peel off paper. Using a serrated knife, cut into squares.