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

Using trait alias feature instead of auto macro #1

Closed
adamAndMath opened this issue Jun 16, 2019 · 2 comments
Closed

Using trait alias feature instead of auto macro #1

adamAndMath opened this issue Jun 16, 2019 · 2 comments

Comments

@adamAndMath
Copy link
Contributor

If I understand your auto macro correctly, you have essentially reimplemented the trait alias feature. As this library already utilizes several unstable features, I suggest replacing all uses of the auto macro with trait aliases.
This would turn all auto macros into shorthands for their requirements. Thus make the type-checker complain about the specific base traits that are missing instead of stating that the specific group isn't implemented.
This may very well not be desired, as the context is lost, but it makes it more clear what is actually wrong.

@adamAndMath
Copy link
Contributor Author

This is currently not possible do to Trait alias makes method call ambigous.
I could move the conflicting traits and impls into separate folders to work around this.

@jsmith628
Copy link
Owner

Back when I implemented the macro, trait aliases hadn't been added. In fact, I tried to see if they were a feature I could use and was pretty surprised when they weren't. However, it seems I wasn't paying attention and they were added in the time since I did that.

Now, on the topic of the compiler output, the error messages it currently gives already are effectively as you say as it's smart enough to figure out and say that the "alias" isn't implemented because of one of the feature traits. Of course, it does mention the alias, but it's such a small part of the message that it's not really worth using an alternate implementation of a base language feature for it.

In any case, I went ahead and pulled your changes into the testing branch. I'm going to leave them there for now until more features and/or documentation is added since it doesn't really change the system at all and potentially to wait for that issue gets fixed.

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

2 participants