opprop / immutability

The Practical Immutability for Classes and Objects (PICO) type system enforces transitive class and object immutability
Other
3 stars 5 forks source link

Immutable field annotation interact with initialization checker #42

Open Ao-senXiong opened 7 months ago

Ao-senXiong commented 7 months ago

Despite PICO is not up to date at the moment, I will use issues to make notes for myself and leave a comment section for discussion of desired behaviour.

public class Demo {
   @Immutable Object o1, o2;

    Demo(Object obj1, Object obj2) {
    }
}

I think we are expecting fields not initialized error, but right now there is now errors.

Ao-senXiong commented 7 months ago

Also for static Immutable field,

public class Demo {
   static @Immutable Object o1, o2;

    Demo(Object obj1, Object obj2) {
    }
}
Ao-senXiong commented 5 months ago

Should add a test case for this in the future.