Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feather: "with(global)" gives an incorrect GM2021 error saying global cannot be referenced in this way #9107

Open
2 tasks
sihammill opened this issue Jan 21, 2025 · 2 comments
Assignees
Labels
ide-bug Bugs with the GameMaker IDE
Milestone

Comments

@sihammill
Copy link

sihammill commented Jan 21, 2025

Description

Using the below code show the tooltip on the global variable that it cannot be referenced in this way, however, when compiled it appears there is no issue referencing it in this way at all

with (global) {
   a = 1;
   b = 2;
   c = 4;
    
    show_debug_message(global);
}

Image

Expected Change

If the 'global' variable is said to not be referenced in a 'with' statement, sure it should throw an error, or the tooltip on the 'global' variable be removed.

Steps To Reproduce

  1. Start GameMaker
  2. Create a new project and copy the above code in to an object
  3. Hover over the global variable
  4. See the issue
  5. Run the project
  6. See it works fine

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

Always

Which version of GameMaker are you reporting this issue for?

2024.1300 (Betas)

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

Windows 11

Are you running GameMaker from inside your Steam library?

None

Sample Package Attached?

  • I have attached my bug package

Sample Project Added?

  • I have included a small sample project
@sihammill sihammill added the ide-bug Bugs with the GameMaker IDE label Jan 21, 2025
@YYDan YYDan changed the title In-Game: Referencing the global variable within a 'with' statement states it cannot be referenced, yet if runs fine when complied In-Game: [VM] with(global) shows a Feather GM2021 error and YYC will fail the build, yet VM runs it correctly Jan 21, 2025
@stuckie stuckie moved this from Triage to Backlog in Team Workload Jan 22, 2025
@rwkay rwkay assigned zreedy and unassigned rwkay Jan 23, 2025
@rwkay
Copy link

rwkay commented Jan 23, 2025

This is actually possible in modern GML so I suspect the Feather error is just outdated - give me a shout Zach if you want to talk about it.

@rwkay rwkay closed this as completed Jan 23, 2025
@github-project-automation github-project-automation bot moved this from Backlog to Done in Team Workload Jan 23, 2025
@rwkay rwkay reopened this Jan 23, 2025
@github-project-automation github-project-automation bot moved this from Done to Triage in Team Workload Jan 23, 2025
@YYDan YYDan changed the title In-Game: [VM] with(global) shows a Feather GM2021 error and YYC will fail the build, yet VM runs it correctly Feather: "with(global)" gives an incorrect Feather GM2021 error saying global cannot be refenced in this way Jan 23, 2025
@YYDan YYDan changed the title Feather: "with(global)" gives an incorrect Feather GM2021 error saying global cannot be refenced in this way Feather: "with(global)" gives an incorrect GM2021 error saying global cannot be referenced in this way Jan 23, 2025
@stuckie stuckie moved this from Triage to Todo in Team Workload Jan 24, 2025
@stuckie stuckie added this to the 2024.13 milestone Jan 24, 2025
@zreedy zreedy moved this from Todo to In Progress in Team Workload Jan 28, 2025
@zreedy
Copy link

zreedy commented Jan 28, 2025

Fixed. As Russell had mentioned, this is an archaic holdover from prior to GMLv2.3
I have removed GM2021 from the analysis that Feather will perform.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ide-bug Bugs with the GameMaker IDE
Projects
Status: In Progress
Development

No branches or pull requests

4 participants