Skip to content

Commit

Permalink
fixes #11188 (#11319)
Browse files Browse the repository at this point in the history
  • Loading branch information
Araq authored May 24, 2019
1 parent ef8ddef commit 7e53c1c
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 2 deletions.
4 changes: 2 additions & 2 deletions compiler/semgnrc.nim
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@ proc fuzzyLookup(c: PContext, n: PNode, flags: TSemGenericFlags,
result = n
let n = n[1]
let ident = considerQuotedIdent(c, n)
var s = searchInScopes(c, ident).skipAlias(n, c.config)
if s != nil and s.kind in routineKinds:
var s = searchInScopes(c, ident, routineKinds).skipAlias(n, c.config)
if s != nil:
isMacro = s.kind in {skTemplate, skMacro}
if withinBind in flags:
result = newDot(result, symChoice(c, n, s, scClosed))
Expand Down
6 changes: 6 additions & 0 deletions tests/modules/mmodule_same_proc.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

# the module being the same name as the proc
# is a requirement to trigger the error
import mmodule_same_proc_client

proc bar*[T](foo: T): bool = foo.mmodule_same_proc_client()
2 changes: 2 additions & 0 deletions tests/modules/mmodule_same_proc_client.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

proc mmodule_same_proc_client*(x: string): bool = x.len > 0
9 changes: 9 additions & 0 deletions tests/modules/tmodule_same_proc.nim
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@

import mmodule_same_proc

# importing baz causes the error not to trigger
#import baz

# bug #11188

discard "foo".bar()

0 comments on commit 7e53c1c

Please sign in to comment.