Skip to content

Commit

Permalink
sema: fix analysis of blank identifiers in use declaration paths
Browse files Browse the repository at this point in the history
  • Loading branch information
mertcandav committed Aug 10, 2024
1 parent 10602a1 commit 40f22be
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions std/jule/sema/symbol.jule
Original file line number Diff line number Diff line change
Expand Up @@ -391,11 +391,7 @@ impl symbolBuilder {
}

fn buildStdImport(mut self, mut &decl: &UseDecl): &ImportInfo {
if strings::Find(decl.LinkPath, "::_") != -1 {
self.pushErr(decl.Token, LogMsg.BlankIdentInUseDecl)
ret nil
}

// No need to check blank identifiers for standart packages.
mut path := decl.LinkPath[len("std::"):] // Skip "std::" prefix.
path = strings::Replace(path, TokenKind.DblColon, str(path::Separator), -1)
path = path::Join(PathStdlib, path)
Expand Down Expand Up @@ -436,8 +432,8 @@ impl symbolBuilder {

fn buildIdentImport(mut &self, mut &decl: &UseDecl): &ImportInfo {
if decl.LinkPath == "_" ||
strings::Find(decl.LinkPath, "::_") != -1 ||
strings::Find(decl.LinkPath, "_::") != -1 {
strings::Find(decl.LinkPath, "::_::") != -1 ||
strings::HasSuffix(decl.LinkPath, "::_") {
self.pushErr(decl.Token, LogMsg.BlankIdentInUseDecl)
ret nil
}
Expand Down

0 comments on commit 40f22be

Please sign in to comment.