non-stub imports should reference entities and not their module

Issue #4 resolved
Damien Cassou created an issue
$ cat test/data/py2mse/import/name-no-alias/fromNonStub.py 
from nonStub import f
$ cat test/data/py2mse/import/name-no-alias/nonStub.py 
def f():
    pass
$ ./bin/py2mse test/data/py2mse/import/name-no-alias/fromNonStub.py 
********************************************************************************
CONVERTING test/data/py2mse/import/name-no-alias/fromNonStub.py
((FAMIX.PyFileAnchor (id: 2)
  (startLine 0)
  (endLine 1)
  (element (ref: 1))
  (fileName 'test/data/py2mse/import/name-no-alias/fromNonStub.py')
)
(FAMIX.PyModule (id: 1)
  (name 'fromNonStub' )
  (isPackage false)
  (isStub false)
  (sourceAnchor (ref: 2))
)
(FAMIX.PyFileAnchor (id: 4)
  (startLine 0)
  (endLine 2)
  (element (ref: 3))
  (fileName 'test/data/py2mse/import/name-no-alias/nonStub.py')
)
(FAMIX.PyModule (id: 3)
  (name 'nonStub' )
  (isPackage false)
  (isStub false)
  (sourceAnchor (ref: 4))
)
(FAMIX.PyFileAnchor (id: 6)
  (startLine 1)
  (endLine 2)
  (element (ref: 5))
  (fileName 'test/data/py2mse/import/name-no-alias/nonStub.py')
)
(FAMIX.PyFunction (id: 5) 
  (container (ref: 3))
  (name 'f')
  (signature 'f()')
  (sourceAnchor (ref: 6))
  (numberOfParameters 0)
)
(FAMIX.PyNameImport (id: 7)
   (name 'f')
   (importedEntity (ref: 3))
   (parentBehaviouralEntity (ref: 1))
)
)

Here we see that the PyNameImport has node 3 (the nonStub module) as its importedEntity. It should be node 5 instead (the function inside the nonStub module).

Comments (2)

  1. Log in to comment