New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

Comments

Projects
None yet
2 participants
@xsleonard

xsleonard commented Jan 11, 2014

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 added a commit to zhaihj/rock that referenced this issue Jun 30, 2014

Search for all imports instead of global imports
This may solve the issue 766 in official repo
ooc-lang#766

@fasterthanlime fasterthanlime added this to the 0.9.9 milestone Aug 15, 2014

@fasterthanlime fasterthanlime self-assigned this Aug 15, 2014

fasterthanlime added a commit that referenced this issue Aug 15, 2014

Search for all imports instead of global imports
This may solve the issue 766 in official repo
#766
@fasterthanlime

This comment has been minimized.

Collaborator

fasterthanlime commented Aug 15, 2014

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