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

log is defined in math and developer packages and has a completely different purpose, we should avoid name collision in the standard library when it make sense #147474

Closed
stephane-archer opened this issue Apr 27, 2024 · 4 comments
Labels
r: invalid Issue is closed as not valid

Comments

@stephane-archer
Copy link

Use case

log is defined in math and developer packages and has a completely different purpose. not the best development experience.
let's say you have:

import developer;

foo() {
int i = 0;
log(i)
}

then you need the math package for bar, you see the collision and do change your import too
import developer as developer; import math then you add developer. when the compiler is complaining
you add up with the following code

import developer as developer;

foo() {
int i = 0;
log(i) // BOOM!
}

bar() {
// my math function
}

Proposal

I think the standard library should avoid collision as much as possible. devLog could be an acceptable name
the math library and the need to log thing is quite commun

@danagbemava-nc danagbemava-nc added the in triage Presently being triaged by the triage team label Apr 29, 2024
@danagbemava-nc
Copy link
Member

This should be reported on the dart-lang/sdk repository as the libraries reference are from the dart sdk.

On a side note, I believe this is the reason aliases can be assigned in to imports. This will happen several times with different libraries serving different purposes using the same names that might have different meanings. This isn't necessarily a bad thing.

Closing from here as this is not a flutter issue.

Thank you

@danagbemava-nc danagbemava-nc closed this as not planned Won't fix, can't repro, duplicate, stale Apr 29, 2024
@danagbemava-nc danagbemava-nc added r: invalid Issue is closed as not valid and removed in triage Presently being triaged by the triage team labels Apr 29, 2024
@stephane-archer
Copy link
Author

@danagbemava-nc I understand that alias is a way to solve the issue but remember to always alias the math
library is not the best developer experience.
I will open the issue on the dart-lang/SDK

@stephane-archer
Copy link
Author

dart-lang/sdk#55590

Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 13, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
r: invalid Issue is closed as not valid
Projects
None yet
Development

No branches or pull requests

2 participants