Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #595 from 9rnsr/fix7190

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