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

Typedef multiple inheritance #6565

Closed
RblSb opened this issue Sep 8, 2017 · 3 comments · Fixed by #7127
Closed

Typedef multiple inheritance #6565

RblSb opened this issue Sep 8, 2017 · 3 comments · Fixed by #7127
Milestone

Comments

@RblSb
Copy link
Member

RblSb commented Sep 8, 2017

Compilation error without comma at the end

typedef Point = {
	x:Float,
	y:Float
}

typedef Size = {
	w:Float,
	h:Float
}

typedef Rect = {
	>Point,
	>Size //add "," to make it work
} //Compilation error here: Test.hx:14: characters 0-1 : Unexpected }

https://try.haxe.org/#12eF7

@nadako
Copy link
Member

nadako commented Sep 8, 2017

I would also like it to support ; for the class notation, e.g.

typedef Some = {
    >Base;
    var field:Int;
}

@Simn
Copy link
Member

Simn commented Sep 18, 2017

If we want to allow the class notation, I think we should disallow the , usage there. In other words, ; should lock you in class notation whereas , locks you in structure notation.

That's a breaking change, but I really don't want to allow mixing ; and , in this syntax...

@Simn
Copy link
Member

Simn commented Jun 6, 2018

We decided to leave this syntax alone and instead focus on the Type1 & Type2 syntax introduced in #7127.

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 a pull request may close this issue.

3 participants