Created
November 24, 2012 07:39
-
-
Save lanwin/4138801 to your computer and use it in GitHub Desktop.
Immutable type checking for Simon
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Mutable { | |
} | |
[Immutable] | |
public class ImmutableB | |
{ | |
public readonly A = new ImmutableA(); | |
} | |
[Immutable] | |
public class ImmutableA | |
{ | |
public readonly M = new Mutable(); // here should the build stop and tell you that you can not use mutable types inside of immutable types. | |
} | |
// Immutable are all types with Immutable attribute + a whitelist of framework types or types from other assemblies. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The detection also need to go far beyond. Like: