| ... | @@ -1032,12 +1032,18 @@ fn walkInstruction( | ... | @@ -1032,12 +1032,18 @@ fn walkInstruction( |
| 1032 | | 1032 | |
| 1033 | // Immediately add this package to the import table of our | 1033 | // Immediately add this package to the import table of our |
| 1034 | // current package, regardless of wether it's new or not. | 1034 | // current package, regardless of wether it's new or not. |
| 1035 | const current_package = self.packages.getPtr(file.pkg).?; | 1035 | if (self.packages.getPtr(file.pkg)) |current_package| { |
| 1036 | _ = try current_package.table.data.getOrPutValue( | 1036 | // TODO: apparently, in the stdlib a file gets analized before |
| 1037 | self.arena, | 1037 | // its package gets added. I guess we're importing a file |
| 1038 | path, | 1038 | // that belongs to another package through its file path? |
| 1039 | self.packages.getIndex(other_package).?, | 1039 | // (ie not through its package name). |
| 1040 | ); | 1040 | // We're bailing for now, but maybe we shouldn't? |
| | 1041 | _ = try current_package.table.data.getOrPutValue( |
| | 1042 | self.arena, |
| | 1043 | path, |
| | 1044 | self.packages.getIndex(other_package).?, |
| | 1045 | ); |
| | 1046 | } |
| 1041 | | 1047 | |
| 1042 | if (result.found_existing) { | 1048 | if (result.found_existing) { |
| 1043 | return DocData.WalkResult{ | 1049 | return DocData.WalkResult{ |