Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

fix Issue 9409 - [2.062-alpha] Regression with $ inside of expression…

… tuples
  • Loading branch information...
commit 679a359204b9b55741f04111f82f9e51ed6b7a48 1 parent d46310b
@9rnsr 9rnsr authored
Showing with 15 additions and 2 deletions.
  1. +1 −1  src/expression.c
  2. +14 −1 test/runnable/xtest46.d
View
2  src/expression.c
@@ -10007,7 +10007,7 @@ Expression *IndexExp::semantic(Scope *sc)
if (!e1->type)
e1 = e1->semantic(sc);
assert(e1->type); // semantic() should already be run on it
- if (e1->op == TOKtype)
+ if (e1->op == TOKtype && e1->type->ty != Ttuple)
{
e2 = e2->semantic(sc);
e2 = resolveProperties(sc, e2);
View
15 test/runnable/xtest46.d
@@ -945,7 +945,6 @@ void test48()
}
/***************************************************/
-
// 6408
static assert(!is(typeof(string[0..1].init)));
@@ -963,6 +962,20 @@ static assert(is(typeof(string[string][string][string].init) == string[string][s
template TT6408(T...) { alias T TT6408; }
static assert(is(typeof(TT6408!(int, int)[].init) == TT6408!(int, int)));
+static assert(is(typeof(TT6408!(int, int)[0..$].init) == TT6408!(int, int)));
+static assert(is(typeof(TT6408!(int, int)[$-1].init) == int));
+
+/***************************************************/
+// 9409
+
+template TT9409(T...) { alias T TT9409; }
+
+template idxTypes9409(Prefix...)
+{
+ TT9409!((Prefix[$-1])) idxTypes9409;
+}
+
+alias idxTypes9409!(int) Types9409;
/***************************************************/
Please sign in to comment.
Something went wrong with that request. Please try again.