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

Use qualified type Crystal::Path in compiler specs #6071

Conversation

straight-shoota
Copy link
Member

This PR adds qualified type Crystal::Path in compiler specs to avoid naming conflicts with top level Path type. It is a prerequisite for #5635 and extracted from there to reduce noise from these many whitespace changes.

@asterite
Copy link
Member

asterite commented May 7, 2018

Looks good to me. Another idea might be to rename the Path class. I don't really like the name, I think it had another name before and then I saw it in some other language's source code (can't remember if it's Rust or C#).

What other name could we use? A Path right now is basically Foo or Foo::Bar::Baz, something that resolves to a constant.

@straight-shoota straight-shoota force-pushed the jm/feature/qualified-crystal-path branch from 250ad7f to 0410ba5 Compare May 7, 2018 15:17
@RX14
Copy link
Contributor

RX14 commented May 7, 2018

you could call it a TypePath or NamespacePath... I don't really like either.

@straight-shoota
Copy link
Member Author

TypeName? 😐

@asterite
Copy link
Member

asterite commented May 7, 2018

I like TypePath. Path is pretty generic (hence the conflict), but TypePath is pretty clear about being a path of types.

@straight-shoota If you want you can tweak this PR to rename Path to TypePath, though I think it will conflict with #6063, so it might be better to merge that one first.

@straight-shoota
Copy link
Member Author

straight-shoota commented May 7, 2018

That should probably better be a new PR because it's a completely different solution.

Anyway, it's not super urgent because #5635 probably needs quite some work before that. So it's no deal to wait if hopefully #6063 can get merged soon.

@RX14
Copy link
Contributor

RX14 commented May 7, 2018

@asterite can't a TypePath be a path to a constant though? ::Foo::Bar::CONSTANT is parsed as a Path right?

@asterite
Copy link
Member

asterite commented May 7, 2018

@RX14 That's correct. But a constant is represented internally as a type too 😛

@RX14
Copy link
Contributor

RX14 commented May 7, 2018

OK, sounds fine to me then

@sdogruyol
Copy link
Member

I think this is fine as it is 👍 @straight-shoota can you rebase?

@straight-shoota straight-shoota force-pushed the jm/feature/qualified-crystal-path branch from 0410ba5 to 286090c Compare June 5, 2018 09:27
@straight-shoota
Copy link
Member Author

Rebased

@RX14
Copy link
Contributor

RX14 commented Jun 5, 2018

needs a format

@sdogruyol sdogruyol merged commit a64e603 into crystal-lang:master Jun 6, 2018
@straight-shoota straight-shoota deleted the jm/feature/qualified-crystal-path branch June 6, 2018 13:06
chris-huxtable pushed a commit to chris-huxtable/crystal that referenced this pull request Jun 6, 2018
@RX14 RX14 added this to the 0.25.0 milestone Jun 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants