ceylon / ceylon-js

DEPRECATED
Apache License 2.0
54 stars 9 forks source link

Never-ending loop when iterating over members #488

Closed thradec closed 9 years ago

thradec commented 9 years ago

This code runs forever ...

shared void run() {
    for(f in `package foo`.members<FunctionDeclaration>()) {
        print(f);
    }
}
chochos commented 9 years ago

Does it print the same member every time or does it cycle over all the members?

chochos commented 9 years ago

I just tested this with package ceylon.language.meta and it worked OK, no loop

chochos commented 9 years ago

Also tried this with 2 different modules I wrote p1 and p2, and it worked fine.

thradec commented 9 years ago

Sorry, I simplified it too much. Can you please try this code ...

import ceylon.language.meta.declaration {
    FunctionDeclaration
}
import ceylon.test {
    TestAnnotation,
    test
}

shared test void run() {
    for(f in `package com.acme.foo`.annotatedMembers<FunctionDeclaration, TestAnnotation>()) {
        print(f);
    }
}

... it print finished in loop

chochos commented 9 years ago

Still can't reproduce... iterating over a package's annotatedMembers works well, I tested with SharedAnnotation and DefaultAnnotation (to test for empty result) and it all worked, both with package ceylon.language.meta and with a simple test package I wrote.

thradec commented 9 years ago

Dammit, it was because I imported old version of ceylon.test 1.1.0 with current version 1.1.1 it works (anyway thanks).