Skip to content

[FIX] Allow imports with module names to work#398

Open
NotHyper-474 wants to merge 1 commit intoFunkinCrew:experimentalfrom
NotHyper-474:fix/module-importing
Open

[FIX] Allow imports with module names to work#398
NotHyper-474 wants to merge 1 commit intoFunkinCrew:experimentalfrom
NotHyper-474:fix/module-importing

Conversation

@NotHyper-474
Copy link
Copy Markdown
Collaborator

@NotHyper-474 NotHyper-474 commented Apr 23, 2026

This PR makes it so doing imports like foo.bar.Waldo.Fred work instead of having to write it as foo.bar.Fred. The fix is such a no-brainer which surprises me someone hasn't tried to do it yet.

Note that this technically makes it so putting anything as the module will work, but I don't think there's a way to validate that (we have enough macros already) and I don't think it's really worth it since this PR just makes it more convenient to use hscript with auto-completion.

The scary diff is from me trying to avoid boilerplate code.

Copy link
Copy Markdown
Member

@EliteMasterEric EliteMasterEric left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I happened to have import haxe.Unserializer; in a script where I was testing blacklist stuff.

Before this PR, it silently fails to import, then throws an error when you try to access the blacklisted module when you call a function that uses the import.

After this PR, it throws an error when trying to import (one that doesn't mention the fact the module is blacklisted).

Image

Either revert to the previous behavior (script error thrown when calling the blacklisted class) or add an error when attempting to import the blacklisted class.

@NotHyper-474 NotHyper-474 force-pushed the fix/module-importing branch from b16de99 to b49f76a Compare April 30, 2026 03:44
@NotHyper-474
Copy link
Copy Markdown
Collaborator Author

Fixed by reverting to the previous behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants