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 abstract #10513

Merged
merged 6 commits into from
Jan 4, 2022
Merged

Abstract abstract #10513

merged 6 commits into from
Jan 4, 2022

Conversation

RblSb
Copy link
Member

@RblSb RblSb commented Nov 30, 2021

Closes #10482

@RealyUniqueName RealyUniqueName added this to the Release 4.3 milestone Nov 30, 2021
@RealyUniqueName
Copy link
Member

LGTM. @Simn ?

| (MGet, KAbstractImpl ab)
| (MCall _, KAbstractImpl ab) ->
let t = TAbstract (ab,[]) in
let block = mk (TBlock [(get_this ctx p)]) t p in
Copy link
Member

Choose a reason for hiding this comment

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

Are you sure TBlock is required here?

Copy link
Member Author

Choose a reason for hiding this comment

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

mk (TCast ((get_this ctx p), None)) t p also works, but ide hint for abstract will be this:String instead of MyAbstract. Is there a better way to type (get_this ctx p) with TAbstract?

Copy link
Member

Choose a reason for hiding this comment

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

Try this:

haxe/src/typing/typer.ml

Lines 340 to 341 in 3fac24b

let e = get_this ctx p in
let e = {e with etype = TAbstract(a,tl)} in

Copy link
Member Author

Choose a reason for hiding this comment

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

Cool, but still looks like this:String or this:T instead of MyAbstract on hover. Maybe this can be improved in display stuff someway, but maybe TBlock is fine?

Copy link
Member

@RealyUniqueName RealyUniqueName Dec 2, 2021

Choose a reason for hiding this comment

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

Maybe this can be improved in display stuff someway

Hmm... I don't know. Maybe @Simn knows. But TBlock is out of place here.

Copy link
Member

Choose a reason for hiding this comment

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

Yes let's not add random TBlock nodes like that. I can check the display situation, maybe you could add a failing test for it.

@skial skial mentioned this pull request Dec 1, 2021
1 task
@RealyUniqueName
Copy link
Member

Add a display test please. So we can be sure completion works as expected.

@Simn Simn merged commit 43f28cc into HaxeFoundation:development Jan 4, 2022
@RblSb RblSb deleted the abstract_kwd branch January 4, 2022 09:46
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.

Implement abstract to access the abstract
3 participants