Skip to content

mutual dependent class not working #65

@l22141

Description

@l22141

below code in a cell is not working:

class Animal {
    public void act(List<? extends Animal> list) {
        for (Animal animal : list) {
            animal.eat();
        }
    }
    
    public void aboutShepherdDog(List<? super ShepherdDog> list) {
        System.out.println("About shepherdDog");
    }
    
    public void eat() {
        System.out.println("Eating");
    }
}
class Dog extends Animal {}
class Cat extends Animal {}
class ShepherdDog extends Dog {}

when running in a cell, output is :

|   class Animal {
|       public void act(List<? extends Animal> list) {
|           for (Animal animal : list) {
|               animal.eat();
|           }
|       }
|       
|       public void aboutShepherdDog(List<? super ShepherdDog> list) {
|           System.out.println("About shepherdDog");
|       }
|       
|       public void eat() {
|           System.out.println("Eating");
|       }
|   }

Unresolved dependencies:
   - class ShepherdDog

but this code is OK for jshell.
kernel version: the the latest jjava-1.0-a4-kernelspec.zip was installed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions