Skip to content

[FIX] Fix dotted path instantiation and resolving. and support generic type when instanting - #535

Merged
AbnormalPoof merged 2 commits into
FunkinCrew:developfrom
ahmed7p:Fix-New
Oct 5, 2026
Merged

AbnormalPoof merged 2 commits into
FunkinCrew:developfrom
ahmed7p:Fix-New

Conversation

@ahmed7p

@ahmed7p ahmed7p commented Oct 5, 2026 •

Copy link
Copy Markdown

This PR fixes dotted path instantiation and resolving, and adds support for generic types when instantiating.

Changed

  • Generic Type Parsing: Updates the parser to support type parameters within new expressions (e.g., new StringMap<Class<Dynamic>>()).
  • Dotted Path Instantiation: Adds fallback resolution via dotted paths in cnew for classes, abstracts, and static references.
  • Class & Package Reference: Fixes field access and resolution so accessing base class or package references directly (e.g., flixel.FlxG without a trailing field) no longer throws errors.

Example

// 1. Dotted path instantiation (Now works without explicit imports)
var spr = new flixel.FlxSprite();

// 2. Standalone dotted path resolution (No longer throws without trailing fields)
var core = flixel.FlxG;

// 3. Generic types in instantiation (Now safely parses without errors)
var myMap = new StringMap<Class<Dynamic>>();

@NotHyper-474

Copy link
Copy Markdown
Contributor

StringMap<String, ...>? It only accepts one type parameter.

@ahmed7p

ahmed7p commented Oct 5, 2026

Copy link
Copy Markdown
Author

StringMap<String, ...>? It only accepts one type parameter.

oh so i just made a bad example then let me change that

@AbnormalPoof
AbnormalPoof merged commit c8a021f into FunkinCrew:develop Oct 5, 2026
9 checks passed
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.

3 participants