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

Conditionalized class declaration with constraints #431

Closed
Gama11 opened this issue Apr 7, 2019 · 2 comments
Closed

Conditionalized class declaration with constraints #431

Gama11 opened this issue Apr 7, 2019 · 2 comments
Labels
bug Something isn't working emptylines missing or incorrect empty line

Comments

@Gama11
Copy link
Member

Gama11 commented Apr 7, 2019

Not even syntax highlighting can deal with this properly, so this may not be very high-priority. :)

#if (haxe_ver >= "4.0.0")
class FlxTypedEmitter<T:FlxSprite & IFlxParticle> extends FlxTypedGroup<T>
#else
class FlxTypedEmitter<T:(FlxSprite, IFlxParticle)> extends FlxTypedGroup<T>
#end
{}

turns into:

#if (haxe_ver >= "4.0.0")
class FlxTypedEmitter<T:FlxSprite & IFlxParticle> extends FlxTypedGroup<T>
#else
class FlxTypedEmitter<T:(FlxSprite, IFlxParticle) > extends FlxTypedGroup<T>
#end
{}

(note the space that's inserted before the >)

@Gama11 Gama11 added bug Something isn't working whitespace missing or incorrect space around token labels Apr 7, 2019
@Gama11
Copy link
Member Author

Gama11 commented Apr 7, 2019

Looks like this also removes the empty line that's meant to come after the class, if there's multiple types:

#if (haxe_ver >= "4.0.0")
class FlxTypedEmitter<T:FlxSprite & IFlxParticle> extends FlxTypedGroup<T>
#else
class FlxTypedEmitter<T:(FlxSprite, IFlxParticle) > extends FlxTypedGroup<T>
#end
{
	var foo:Int;
}
enum Foo {}

AlexHaxe added a commit to AlexHaxe/haxe-formatter that referenced this issue Mar 23, 2020
@AlexHaxe AlexHaxe added emptylines missing or incorrect empty line and removed whitespace missing or incorrect space around token labels Mar 23, 2020
@AlexHaxe
Copy link
Member

whitespace issue fixed, emptylines still open

AlexHaxe added a commit that referenced this issue Oct 4, 2024
fixed empty classes with conditional metadata
fixed class fields with conditional function signatures
fixed abstract enum abstracts with conditionals
AlexHaxe added a commit that referenced this issue Oct 4, 2024
AlexHaxe added a commit that referenced this issue Oct 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working emptylines missing or incorrect empty line
Projects
None yet
Development

No branches or pull requests

2 participants