Permalink
Browse files

[attributes] syntax is superceded by @(attributes)

  • Loading branch information...
1 parent af2c21b commit a04cf864b932061ad7b72e7cad8b16fabc6a825a @WalterBright WalterBright committed Dec 10, 2012
Showing with 2 additions and 0 deletions.
  1. +1 −0 src/parse.c
  2. +1 −0 src/statement.c
View
@@ -493,6 +493,7 @@ Dsymbols *Parser::parseDeclDefs(int once)
case TOKlbracket:
{
+ warning(loc, "use @(attributes) instead of [attributes]");
@klickverbot

klickverbot Dec 10, 2012

Member

Why not just drop the [] syntax altogether? UDAs haven't been released yet, and might not even be in the next release.

@WalterBright

WalterBright Dec 10, 2012

Owner

Because some people were using it.

@klickverbot

klickverbot Dec 10, 2012

Member

This shouldn't be a problem if it is a pre-release version. You expect stuff to break if you are using a development snapshot.

@jmdavis

jmdavis Dec 13, 2012

Member

Yeah. What's the point in warning about stuff when it hasn't even been released? Just change it and be done with it. I don't see how anyone can expect a new feature which hasn't even been release to necessarily work exactly as it is without any changes before it's actually released. Anyone currently using it is using it at their own risk, and I think that it's foolish to carry technical debt around like this when we don't need to.

@donc

donc Dec 13, 2012

Collaborator

++int.max. This has not appeared in any release, and never been documented. You can assume that it's only ever existed in experimental code.

Expressions *exps = parseArguments();
a = parseBlock();
s = new UserAttributeDeclaration(exps, a);
View
@@ -5432,6 +5432,7 @@ Statement *ImportStatement::semantic(Scope *sc)
}
s->semantic(sc);
+ s->semantic2(sc);
@MartinNowak

MartinNowak Dec 10, 2012

Member

This line causes a compiler ICE when the imported module is not found.
How is it related to the added warning?

@WalterBright

WalterBright Dec 10, 2012

Owner

It isn't related, it was for the previous change.

Anyhow, I just fixed the breakage.

@9rnsr

9rnsr Jun 10, 2015

Member

I'm really not sure why he added the line. It's actually causing a regression issue 14666, so I'm trying to remove it in #4735.

sc->insert(s);
for (size_t i = 0; i < s->aliasdecls.dim; i++)

1 comment on commit a04cf86

Owner

CyberShadow commented on a04cf86 Jun 10, 2015

This commit introduced a regression:
https://issues.dlang.org/show_bug.cgi?id=14666

Please sign in to comment.