1- module Test.Samples.Proto.CompilerInput (compilerInput'incoherent , compilerInput'maybe , compilerInput'doubleDeclaration ) where
1+ module Test.Samples.Proto.CompilerInput (compilerInput'incoherent , compilerInput'maybe , compilerInput'doubleDeclaration , compilerInput'doubleDeclarationDiffMod ) where
22
3- import Control.Lens ((&) , (.~) )
3+ import Control.Lens ((%~) , ( &) , (.~) )
44import LambdaBuffers.Compiler.ProtoCompat qualified as P
55import Test.Samples.Proto.Module (module'incoherent , module'maybe )
6+ import Test.Samples.Proto.SourceInfo
7+
8+ _CompilerInput x = P. CompilerInput {P. modules = x}
69
710-- | Compiler Input containing 1 module with 1 definition - Maybe.
811compilerInput'maybe :: P. CompilerInput
9- compilerInput'maybe = P. CompilerInput { P. modules = [module'maybe]}
12+ compilerInput'maybe = _CompilerInput [module'maybe]
1013
1114-- | Contains 2 definitions - 1 wrong one.
1215compilerInput'incoherent :: P. CompilerInput
@@ -15,3 +18,11 @@ compilerInput'incoherent = compilerInput'maybe & #modules .~ [module'incoherent]
1518-- | Declares maybe twice.
1619compilerInput'doubleDeclaration :: P. CompilerInput
1720compilerInput'doubleDeclaration = compilerInput'maybe <> compilerInput'maybe
21+
22+ -- | Declares maybe twice - in different modules
23+ compilerInput'doubleDeclarationDiffMod :: P. CompilerInput
24+ compilerInput'doubleDeclarationDiffMod =
25+ compilerInput'maybe
26+ <> _CompilerInput
27+ [ module'maybe & # moduleName . # parts %~ (P. ModuleNamePart " Module" sourceInfo'empty : )
28+ ]
0 commit comments