recursive modules are only detected to improve error messages
This commit is contained in:
parent
bc9015df50
commit
01ae0d28d4
12 changed files with 57 additions and 23 deletions
|
|
@ -2,6 +2,7 @@ discard """
|
|||
file: "mrecmod.nim"
|
||||
line: 1
|
||||
errormsg: "recursive module dependency detected"
|
||||
disabled: true
|
||||
"""
|
||||
# recursive module
|
||||
import mrecmod
|
||||
|
|
|
|||
|
|
@ -1,15 +1,13 @@
|
|||
discard """
|
||||
file: "mrecmod2.nim"
|
||||
line: 2
|
||||
errormsg: "recursive module dependency detected"
|
||||
output: "4"
|
||||
"""
|
||||
type
|
||||
T1* = int # Module A exports the type ``T1``
|
||||
|
||||
import mrecmod2 # the compiler starts parsing B
|
||||
|
||||
# the manual says this should work
|
||||
proc main() =
|
||||
var i = p(3) # works because B has been parsed completely here
|
||||
echo p(3) # works because B has been parsed completely here
|
||||
|
||||
main()
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
discard """
|
||||
file: "tselfimport.nim"
|
||||
line: 7
|
||||
errormsg: "recursive module dependency detected"
|
||||
errormsg: "A module cannot import itself"
|
||||
"""
|
||||
import strutils as su # guard against regression
|
||||
import tselfimport #ERROR
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue