- auto sm = findStructMember(p,\r
- typeExpr(p, globalNamespace, *e._dot.expr), e._dot.identifier);\r
+ // assume dot access is always member access\r
+ // and lookup struct variable\r
+ auto tiCaller = typeExpr(globalCtx, *e._dot.expr);\r
+ if (!tiCaller.isStruct)\r
+ throw "Accessing member of non-struct";\r
+ auto s = findStruct(tiCaller.type.name, tiCaller.type.namespacePrefixes, globalCtx);\r
+ if (!s.has_value())\r
+ throw "Calling method on unknown struct";\r
+ auto sm = findStructMember(e._dot.identifier, std::get<0>(*s));\r