Skip to content

Commit

Permalink
resolve classes from "export" methods in .modulite.yaml (#1017)
Browse files Browse the repository at this point in the history
  • Loading branch information
tolk-vm authored Jun 18, 2024
1 parent 4afc18c commit b20aead
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions compiler/pipes/collect-required-and-classes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,10 @@ class CollectRequiredPass final : public FunctionPassBase {
if (seems_like_classname) {
require_class(modulite->modulite_namespace + e);
}
size_t pos_classmember = e.find("::");
if (pos_classmember != std::string::npos) {
require_class(modulite->modulite_namespace + e.substr(0, pos_classmember));
}
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export:
- "Strings010"
- "UnreachableClass010"
- "UnreachableNs\\AnotherUn010"
- "UnreachableNs\\BnotherUn010::nothing()"

require:

Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<?php

namespace Utils010\UnreachableNs;

class BnotherUn010 {
static public function nothing() {}
}

0 comments on commit b20aead

Please sign in to comment.