Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge pull request #595 from 9rnsr/fix7190

Issue 7190 - Tuple length incorrect
  • Loading branch information...
commit 39124548bdab79769afe5699c50fe6e79421bcda 2 parents 0e5e1b7 + f2635c9
Walter Bright authored January 01, 2012
2  src/mtype.c
@@ -7219,6 +7219,7 @@ Expression *TypeStruct::dotExp(Scope *sc, Expression *e, Identifier *ident)
7219 7219
          * (e.field0, e.field1, e.field2, ...)
7220 7220
          */
7221 7221
         e = e->semantic(sc);    // do this before turning on noaccesscheck
  7222
+        e->type->size();        // do semantic of type
7222 7223
         Expressions *exps = new Expressions;
7223 7224
         exps->reserve(sym->fields.dim);
7224 7225
         for (size_t i = 0; i < sym->fields.dim; i++)
@@ -7672,6 +7673,7 @@ Expression *TypeClass::dotExp(Scope *sc, Expression *e, Identifier *ident)
7672 7673
         /* Create a TupleExp
7673 7674
          */
7674 7675
         e = e->semantic(sc);    // do this before turning on noaccesscheck
  7676
+        e->type->size();        // do semantic of type
7675 7677
         Expressions *exps = new Expressions;
7676 7678
         exps->reserve(sym->fields.dim);
7677 7679
         for (size_t i = 0; i < sym->fields.dim; i++)
7  test/compilable/extra-files/example7190/controllers/HomeController.d
... ...
@@ -0,0 +1,7 @@
  1
+module example7190.controllers.HomeController;
  2
+
  3
+import serenity7190.core.Controller;
  4
+
  5
+class HomeController : Controller {
  6
+    mixin register!(HomeController);
  7
+}
11  test/compilable/extra-files/example7190/models/HomeModel.d
... ...
@@ -0,0 +1,11 @@
  1
+module example7190.models.HomeModel;
  2
+
  3
+import serenity7190.core.Model;
  4
+
  5
+struct Article {
  6
+    ulong id;
  7
+}
  8
+
  9
+class HomeModel : Model {
  10
+    private SqlitePersister!Article mArticles;
  11
+}
8  test/compilable/extra-files/serenity7190/core/Controller.d
... ...
@@ -0,0 +1,8 @@
  1
+class Controller {
  2
+    mixin template register(T : Controller) {
  3
+        enum _s_pkg = __traits(parent, __traits(parent, __traits(parent, T))).stringof["package ".length .. $];
  4
+
  5
+        enum _s_model = T.stringof[0 .. $-`Controller`.length] ~ `Model`;
  6
+        mixin(q{enum _ = is(} ~ _s_pkg ~ q{.models.} ~ _s_model ~ q{.} ~ _s_model ~ q{ : serenity7190.core.Model.Model);});
  7
+    }
  8
+}
5  test/compilable/extra-files/serenity7190/core/Model.d
... ...
@@ -0,0 +1,5 @@
  1
+class SqlitePersister(T) {
  2
+    static assert(T.tupleof.length > 0, T.stringof ~ `(` ~ (T.tupleof.length + '0') ~ `): ` ~ T.tupleof.stringof);
  3
+}
  4
+
  5
+class Model {}
7  test/compilable/test7190.d
... ...
@@ -0,0 +1,7 @@
  1
+// PERMUTE_ARGS:
  2
+// REQUIRED_ARGS: -c -Icompilable/extra-files
  3
+
  4
+import example7190.controllers.HomeController;
  5
+import example7190.models.HomeModel;
  6
+
  7
+void main(){}

0 notes on commit 3912454

Please sign in to comment.
Something went wrong with that request. Please try again.