YoYoGames / GameMaker-Bugs

Public tracking for GameMaker bugs
26 stars 8 forks source link

Feather: Add a message warning against defining macros in weird places #7665

Open DragoniteSpam opened 2 months ago

DragoniteSpam commented 2 months ago

Description

if you put a macro in (for example) after a return statement or inside an unreachable block, feather will give you an "unreachable code" message

  switch (current_day) {
      case 1:
          return;
          #macro macro_name "¯\_(ツ)_/¯";
  }

image

like obviously you shouldn't ever actually do this, but it's also not "unreachable" since macros aren't really "code"

talked with zach a bit and it seems like the best thing to do about this would be to have a broad rule that says "only define macros in the top level of code flies, functions, or object events" or something, because if you hide them anywhere else you're kind of asking for trouble

Steps To Reproduce

  1. Start GameMaker
  2. See the issue

How reliably can you recreate this issue using your steps above?

Always

Which version of GameMaker are you reporting this issue for?

2024.8.0 (Monthly), 2024.800 (Betas)

Which operating system(s) are you seeing the problem on?

Windows 10

Are you running GameMaker from inside your Steam library?

No

Sample Package Attached?

Sample Project Added?

Totobal5 commented 2 months ago

add this please.