Importing into namespace prevents extended method calls from being resolved #766

Closed
xsleonard opened this Issue Jan 11, 2014 · 1 comment

Projects

None yet

2 participants

@xsleonard

Given these files in the same directory:

y.ooc:

X: cover from int*

x.ooc:

import y

extend X {
    draw: func() {
        "draw" println()
    }
}

makeX: func() -> X {
    return 0 as X
}

main.ooc:

import x

makeX() draw()

main2.ooc:

import x into z

z makeX() draw()

main.ooc will successfully compile and run, but main2.ooc fails with:
./main2.ooc:3:3 error No such function draw() for 'X'

@zhaihj zhaihj added a commit to zhaihj/rock that referenced this issue Jun 30, 2014
@zhaihj zhaihj Search for all imports instead of global imports
This may solve the issue 766 in official repo
ooc-lang#766
8865172
@fasterthanlime fasterthanlime added this to the 0.9.9 milestone Aug 15, 2014
@fasterthanlime fasterthanlime self-assigned this Aug 15, 2014
@fasterthanlime fasterthanlime added a commit that referenced this issue Aug 15, 2014
@zhaihj @fasterthanlime zhaihj + fasterthanlime Search for all imports instead of global imports
This may solve the issue 766 in official repo
#766
26e3c6d
@fasterthanlime
Collaborator

Applied @zhaihj's fix, now works in 99x.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment