-
-
Notifications
You must be signed in to change notification settings - Fork 609
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
Protection trait #856
Protection trait #856
Conversation
| if (dim != 1) | ||
| goto Ldimerror; | ||
| PROT protection = PROTundefined; | ||
| Object *o = args->tdata()[0]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Walter will get mad if you use tdata!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(Finally looking at this again!) What should it be? Most the other code uses this same member. (I started this by copying the " else if (ident == Id::identifier)" branch)
|
ping |
|
I've been very busy the last several weeks and intend to get back |
|
This is a useful trait. Ping @adamdruppe. |
|
I went through and added some comments a while ago about details... I don't know how to solve all the comments' concerns myself. |
|
I just pushed up some new code. I think this covers all the bases - both kinds of dot expressions and, of course, symbols. I also updated the style to match dmd git. There's still the duplication of the protection names though. I just wanted to do one thing at a time though, we could DRY that in a separate little pull. |
|
Considering we have the ParameterStorageClass/FunctionAttribute enums I think we should also introduce a |
|
Yeah, that'd be easy enough, though we'll sadly have to find names other that "public" etc. thanks to keywords. Ugh. But the phobos change can happen after the compiler is updated. |
|
Yup. I typically use uppercase names to avoid clashes. |
|
Btw this pull will fix an undiscovered bug in std.typecons: module inter;
interface Inter
{
protected void test();
}module test;
import inter;
import std.typecons;
void main()
{
auto o = new BlackHole!Inter;
o.test(); // works, o.test was declared public
}BlackHole will be able to set the right protection attribute and disallow the above from compiling. I'd imagine this pull will be welcome for these sorts of templates that deal with classes. |
|
Great. Could you please file that so we keep track of it? Thanks! |
|
Hmm, the autotester is saying a test fails, but it works on my box, and I don't think my changes here could be responsible anyway. http://d.puremagic.com/test-results/pull-history.ghtml?repoid=1&pullid=856 It looks like it was passing until last night though, and I haven't changed anything.... is this something I should worry about? |
|
The master is broken, so it's not shocking that all pulls on top of that are also broken. It doesn't happen often, but when it does, it's annoying. Glare at @WalterBright for checking in broken code. |
| DotVarExp *dv = (DotVarExp *)e; | ||
| s = dv->var->isDeclaration(); | ||
| } | ||
| else if (e->op == TOKvar) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is redundant code, because getDsymbol catches TOKvar.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On Sat, Sep 29, 2012 at 01:39:48PM -0700, Hara Kenji wrote:
This is redundant code, because
getDsymbolcatchesTOKvar.
ok, removed. The DotVar one is still needed to pass the test using
traits(getMember) though.
|
OK, now implementation looks good to me. |
|
Maybe squash the commits together? |
|
On Sat, Sep 29, 2012 at 02:51:27PM -0700, David Nadlinger wrote:
I have no idea how to do that..... |
http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html |
|
eh i tried it and think got some success, but it was complaining about merge conflicts and rejected non-fast-forward and other stuff. But it still builds so I'm gonna leave it here. |
|
@adamdruppe if you are on IRC I can help you with it |
|
On Sun, Oct 07, 2012 at 01:22:29PM -0700, Damian Ziemba wrote:
I probably will be later today. Thanks! |
|
I read some more about the git rebase and think I got it right this time. The diff looks clean now... we should be good to go. |
| // which returns a dot expression rather than a symbol | ||
| if(o->dyncast() == DYNCAST_EXPRESSION) | ||
| { | ||
| Expression* e = (Expression*) o; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expression* e = (Expression*) o;
->
Expression *e = (Expression *)o;
|
We now have two commits: one is the protection trait, all changes squashed into one, and the other is removing some duplication on the protection names, by moving json.c's impl into a global area. This should cover everyone's concerns. |
|
Any chance we can get this pulled for the next release? |
I explain it here on the newsgroup:
http://forum.dlang.org/thread/ztpoczjyijaycheqgvph@forum.dlang.org