Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
littlewhitecloud authored Oct 22, 2023
1 parent e0d9568 commit bf5f93c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -365,12 +365,13 @@ static void add_imported_symbol(struct FileState *fs, const ExportSymbol *es, As

static void add_imported_symbols(struct CompileState *compst)
{
// TODO: should it be possible for a file to import from itself?
// Should fail with error?
for (struct FileState *to = compst->files.ptr; to < End(compst->files); to++) {
for (AstImport *imp = to->ast.imports.ptr; imp < End(to->ast.imports); imp++) {
struct FileState *from = find_file(compst, imp->resolved_path);
assert(from);
if (from->path == to->path) {
fail_with_error(imp->location, "the file itself cannot be imported");
}

for (struct ExportSymbol *es = from->pending_exports; es->name[0]; es++) {
if (command_line_args.verbosity >= 2) {
Expand Down

0 comments on commit bf5f93c

Please sign in to comment.