diff options
| author | gingerBill <bill@gingerbill.org> | 2019-05-19 10:01:35 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2019-05-19 10:01:35 +0100 |
| commit | ceb58ae04f3073f2ba400143524240f4ed74b506 (patch) | |
| tree | f07fce0a44eac1082864064468f79ed9b5a91e54 /src/checker.cpp | |
| parent | 868603f6178586a53251544690f302f5f4591b64 (diff) | |
Change import name rules
Diffstat (limited to 'src/checker.cpp')
| -rw-r--r-- | src/checker.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/checker.cpp b/src/checker.cpp index 1f5835bd1..693ed98c5 100644 --- a/src/checker.cpp +++ b/src/checker.cpp @@ -3037,11 +3037,13 @@ void check_add_import_decl(CheckerContext *ctx, Ast *decl) { } String import_name = path_to_entity_name(id->import_name.string, id->fullpath, false); - // String import_name = id->import_name.string; - if (import_name.len == 0 || import_name == "_") { - import_name = scope->pkg->name; - } - if (is_blank_ident(import_name)) { + + // NOTE(bill, 2019-05-19): If the directory path is not a valid entity name, force the user to assign a custom one + // if (import_name.len == 0 || import_name == "_") { + // import_name = scope->pkg->name; + // } + + if (import_name.len == 0 || is_blank_ident(import_name)) { if (id->is_using) { // TODO(bill): Should this be a warning? } else { |