Created
July 6, 2012 21:21
-
-
Save lkuper/3062810 to your computer and use it in GitHub Desktop.
This file contains 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
// Instance coherence enforcement should forbid this situation | |
mod C1 { | |
trait C1Trait { } | |
} | |
mod C2 { | |
type C2Type = int; | |
} | |
mod C3 { | |
import C1; | |
import C2; | |
// conflicts with potential other impls | |
impl of C1Trait for C2Type { } | |
} | |
// But this should be OK: | |
mod C3v2 { | |
import C1; | |
import C2; | |
enum local_myType = myType; | |
impl of C1Trait for local_myType { } | |
} | |
// As should this: | |
mod C1v2 { | |
import C2; | |
trait C1Trait { } | |
impl of C1Trait for C2Type { } | |
} | |
mod C3v2 { | |
import C1v2; // imports the trait as well as its impl | |
} | |
mod C4 { | |
import C1v2; // imports the trait as well as its impl | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment