package error;

import edu.rice.cs.mint.runtime.Code;
import edu.rice.cs.mint.runtime.CodeFree;

import java.util.List;

public class CodeFreeSample3 {
    // -- code container --
    
    public static class CodeContainer {
        Code<Integer> c;
    }
    
    public static class ContainsCodeContainer implements CodeFree {
        CodeContainer cc; // error
    }

    public static class ContainsCodeContainerContainer implements CodeFree {
        ContainsCodeContainer cc; // error (but not reported, because analysis stops at ContainsCodeContainer <: CodeFree)
    }
    
    // -- code returner --

    public static final class CodeReturner {
        Code<Integer> get() { return null; }
    }
    
    public static class ContainsCodeReturner implements CodeFree {
        CodeReturner cr = new CodeReturner(); // error
    }
    
    public static class ContainsCodeReturnerContainer implements CodeFree {
        ContainsCodeReturner cr; // error (but not reported, because analysis stops at ContainsCodeReturner <: CodeFree)
    }
}
