dlang / project-ideas

Collection of impactful projects in the D ecosystem
36 stars 12 forks source link

fix: `private` is ignored when a public overload exists #95

Closed mw66 closed 1 year ago

mw66 commented 1 year ago

Description

fix: private is ignored when a public overload exists

--- test.d
void main()
{
    import bar;
    foo(1); // Compiles, violating private.
}
--- bar.d
import std.stdio;

private void foo(int i)
{
    writeln("Private!!!");
}
void foo()
{
    writeln("Public");
}

https://issues.dlang.org/show_bug.cgi?id=21829

https://github.com/ldc-developers/ldc/issues/3772

What are rough milestones of this project?

make apache-thrift build-able using LDC.

How does this project help the D community?

See also: https://github.com/dlang/projects/issues/89

D is on an one man's island having trouble to cooperate with software components in other languages, due to unfixed bugs for a long time:

-- apache-thrift-d, LDC has build failure, because this bug (logged for a year now):

https://issues.dlang.org/show_bug.cgi?id=22083

-- D grpc client cannot talk to Python grpc server, because this bug (logged for 1.5 year now):

https://github.com/huntlabs/grpc-dlang/issues/15

BTW, apache-thrift and grpc are the most important two rpc frameworks used in the industry.

Recommended skills

DMD front-end.

(If applicable, e.g. GSoC/SAoC)

GSoC & SAoC

What can students expect to get out of doing this project?

experience with DMD front-end.

Point of Contact

References

https://issues.dlang.org/show_bug.cgi?id=21829

https://github.com/ldc-developers/ldc/issues/3772

Geod24 commented 1 year ago

Fixing an issue is usually not a good fit for a project. In that specific case, workarounds exist to make apache-thrift compile, don't they ?

mw66 commented 1 year ago

If you check this comments: it's a non-trivial bug:

https://github.com/dlang/dmd/pull/13257#issuecomment-1019917447

Geod24 commented 1 year ago

It might be, but doesn't it have a trivial workaround ? Namely a static or renamed import ?

mw66 commented 1 year ago

Yes, but thrift guys do not want to take my workaround PR.

It's a frontend bug anyway; and if we fix it, it help all the D projects.

BorisCarvajal commented 1 year ago

I think this should go to the "Discussion" tab on DMD repo. I have a working fix but it's not so elegant so I never committed to it, gonna check it over again.

mw66 commented 1 year ago

@BorisCarvajal as long as it's working, it better than the current situation.

I think you should create a PR, and let people comment on it, maybe others can give better suggestions to improve it.

RazvanN7 commented 1 year ago

Anyway, this is not a project.