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

Abstract over abstract casting #5342

Open
kevinresol opened this issue Jun 8, 2016 · 4 comments
Open

Abstract over abstract casting #5342

kevinresol opened this issue Jun 8, 2016 · 4 comments
Milestone

Comments

@kevinresol
Copy link
Contributor

Typing C in the following code fails with You can only declare from/to with compatible types.
While B is fine.

abstract A(Array<Float>) to Array<Float>{}
abstract B(Array<A>) to Array<Array<Float>> {}
abstract C(Array<B>) to Array<Array<Array<Float>>> {}
@Simn Simn added this to the 3.4 milestone Jul 18, 2016
@Simn
Copy link
Member

Simn commented Jul 18, 2016

I'm not sure if that should work or not.

@Simn Simn modified the milestones: 3.4, 4.0 Jan 9, 2017
@Simn Simn modified the milestones: Release 4.0, Design Apr 17, 2018
@ciscoheat
Copy link
Contributor

I just ran into the same problem on 4.0 preview 4. Will this be fixed, or are there any workarounds?

@kevinresol
Copy link
Contributor Author

kevinresol commented Oct 7, 2018

I think you can work around it with @:from/to and unsafe cast

@ciscoheat
Copy link
Contributor

I managed to, by removing an implicit to cast in the abstract class definition!

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

No branches or pull requests

3 participants