From 760d17d90b2cfb2d3ce572d22593c087e1664e74 Mon Sep 17 00:00:00 2001 From: Jan Mas Rovira Date: Wed, 23 Aug 2023 08:23:10 +0200 Subject: [PATCH] wip --- src/Juvix/Compiler/Concrete/Data/Scope.hs | 2 +- .../Compiler/Concrete/Data/Scope/Base.hs | 1 + src/Juvix/Compiler/Concrete/Language.hs | 102 +++++++++++------- src/Juvix/Compiler/Concrete/Print/Base.hs | 9 +- .../FromParsed/Analysis/Scoping.hs | 73 +++++++++---- .../Analysis/Scoping/Error/Types.hs | 4 +- 6 files changed, 128 insertions(+), 63 deletions(-) diff --git a/src/Juvix/Compiler/Concrete/Data/Scope.hs b/src/Juvix/Compiler/Concrete/Data/Scope.hs index 5a22dd1d32..4be28b29c6 100644 --- a/src/Juvix/Compiler/Concrete/Data/Scope.hs +++ b/src/Juvix/Compiler/Concrete/Data/Scope.hs @@ -16,7 +16,7 @@ import Juvix.Prelude nsEntry :: forall ns. SingI ns => Lens' (NameSpaceEntryType ns) (S.Name' ()) nsEntry = case sing :: SNameSpace ns of SNameSpaceModules -> moduleEntry - SNameSpaceSymbols -> symbolEntry + SNameSpaceSymbols -> preSymbolName SNameSpaceFixities -> fixityEntry mkModuleRef' :: SingI t => ModuleRef'' 'S.NotConcrete t -> ModuleRef' 'S.NotConcrete diff --git a/src/Juvix/Compiler/Concrete/Data/Scope/Base.hs b/src/Juvix/Compiler/Concrete/Data/Scope/Base.hs index ac387e824a..670475858c 100644 --- a/src/Juvix/Compiler/Concrete/Data/Scope/Base.hs +++ b/src/Juvix/Compiler/Concrete/Data/Scope/Base.hs @@ -59,6 +59,7 @@ data ScoperState = ScoperState -- | Local and top modules _scoperModules :: HashMap S.ModuleNameId (ModuleRef' 'S.NotConcrete), _scoperScope :: HashMap TopModulePath Scope, + _scoperAlias :: HashMap S.NameId PreSymbolEntry, _scoperSignatures :: HashMap S.NameId NameSignature, -- | Indexed by the inductive type. This is used for record updates _scoperRecordFields :: HashMap S.NameId RecordInfo, diff --git a/src/Juvix/Compiler/Concrete/Language.hs b/src/Juvix/Compiler/Concrete/Language.hs index 7f9424b2ae..411a61a3af 100644 --- a/src/Juvix/Compiler/Concrete/Language.hs +++ b/src/Juvix/Compiler/Concrete/Language.hs @@ -44,7 +44,7 @@ type Delims = Irrelevant (Maybe (KeywordRef, KeywordRef)) type NameSpaceEntryType :: NameSpace -> GHC.Type type family NameSpaceEntryType s = res | res -> s where - NameSpaceEntryType 'NameSpaceSymbols = SymbolEntry + NameSpaceEntryType 'NameSpaceSymbols = PreSymbolEntry NameSpaceEntryType 'NameSpaceModules = ModuleSymbolEntry NameSpaceEntryType 'NameSpaceFixities = FixitySymbolEntry @@ -255,11 +255,10 @@ deriving stock instance Ord (Import 'Parsed) deriving stock instance Ord (Import 'Scoped) data AliasDef (s :: Stage) = AliasDef - { - _aliasSyntaxKw :: Irrelevant KeywordRef, - _aliasAliasKw :: Irrelevant KeywordRef, - _aliasName :: SymbolType s, - _aliasAsName :: IdentifierType s + { _aliasDefSyntaxKw :: Irrelevant KeywordRef, + _aliasDefAliasKw :: Irrelevant KeywordRef, + _aliasDefName :: SymbolType s, + _aliasDefAsName :: IdentifierType s } deriving stock instance (Show (AliasDef 'Parsed)) @@ -1068,10 +1067,24 @@ instance Eq (ModuleRef'' 'S.Concrete t) where instance Ord (ModuleRef'' 'S.Concrete t) where compare (ModuleRef'' n _ _) (ModuleRef'' n' _ _) = compare n n' +newtype Alias = Alias + { _aliasName :: S.Name' () + } + deriving stock (Show) + +-- | Either an alias or a symbol entry. +data PreSymbolEntry + = PreSymbolAlias Alias + | PreSymbolFinal SymbolEntry + deriving stock (Show) + +-- | A symbol which is not an alias. newtype SymbolEntry = SymbolEntry { _symbolEntry :: S.Name' () } - deriving stock (Show) + deriving stock (Show, Eq, Ord, Generic) + +instance Hashable SymbolEntry newtype ModuleSymbolEntry = ModuleSymbolEntry { _moduleEntry :: S.Name' () @@ -1088,7 +1101,7 @@ instance (SingI t) => CanonicalProjection (ModuleRef'' c t) (ModuleRef' c) where -- | Symbols that a module exports data ExportInfo = ExportInfo - { _exportSymbols :: HashMap Symbol SymbolEntry, + { _exportSymbols :: HashMap Symbol PreSymbolEntry, _exportModuleSymbols :: HashMap Symbol ModuleSymbolEntry, _exportFixitySymbols :: HashMap Symbol FixitySymbolEntry } @@ -1116,23 +1129,11 @@ deriving stock instance Ord (OpenModule 'Parsed) deriving stock instance Ord (OpenModule 'Scoped) -type ScopedIden = ScopedIden' 'S.Concrete - -newtype ScopedIden' (n :: S.IsConcrete) = ScopedIden - { _scopedIden :: RefNameType n +data ScopedIden = ScopedIden + { _scopedIden :: S.Name, + _scopedIdenAlias :: Maybe S.Name } - -deriving stock instance - (Eq (RefNameType s)) => Eq (ScopedIden' s) - -deriving stock instance - (Ord (RefNameType s)) => Ord (ScopedIden' s) - -deriving stock instance - (Show (RefNameType s)) => Show (ScopedIden' s) - -identifierName :: forall n. ScopedIden' n -> RefNameType n -identifierName (ScopedIden n) = n + deriving stock (Show, Eq, Ord) data Expression = ExpressionIdentifier ScopedIden @@ -1263,18 +1264,12 @@ data InfixApplication = InfixApplication } deriving stock (Show, Eq, Ord) -instance HasFixity InfixApplication where - getFixity (InfixApplication _ op _) = fromMaybe impossible (identifierName op ^. S.nameFixity) - data PostfixApplication = PostfixApplication { _postfixAppParameter :: Expression, _postfixAppOperator :: ScopedIden } deriving stock (Show, Eq, Ord) -instance HasFixity PostfixApplication where - getFixity (PostfixApplication _ op) = fromMaybe impossible (identifierName op ^. S.nameFixity) - data Let (s :: Stage) = Let { _letKw :: KeywordRef, _letInKw :: Irrelevant KeywordRef, @@ -1691,6 +1686,7 @@ newtype ModuleIndex = ModuleIndex } makeLenses ''PatternArg +makeLenses ''Alias makeLenses ''FieldPun makeLenses ''RecordPatternAssign makeLenses ''RecordPattern @@ -1702,7 +1698,7 @@ makeLenses ''RecordUpdateField makeLenses ''NonDefinitionsSection makeLenses ''DefinitionsSection makeLenses ''ProjectionDef -makeLenses ''ScopedIden' +makeLenses ''ScopedIden makeLenses ''SymbolEntry makeLenses ''ModuleSymbolEntry makeLenses ''FixitySymbolEntry @@ -1765,10 +1761,10 @@ makeLenses ''NamedArgument makeLenses ''NamedApplication makeLenses ''AliasDef -instance SingI s => HasLoc (AliasDef s) where - getLoc AliasDef {..} = getLoc _aliasSyntaxKw <> getLocIdentifierType _aliasAsName +instance (SingI s) => HasLoc (AliasDef s) where + getLoc AliasDef {..} = getLoc _aliasDefSyntaxKw <> getLocIdentifierType _aliasDefAsName -instance SingI s => HasLoc (SyntaxDef s) where +instance (SingI s) => HasLoc (SyntaxDef s) where getLoc = \case SyntaxFixity t -> getLoc t SyntaxOperator t -> getLoc t @@ -2265,7 +2261,7 @@ instance IsApe InfixApplication ApeLeaf where { _infixFixity = getFixity i, _infixLeft = toApe l, _infixRight = toApe r, - _infixIsDelimiter = isDelimiterStr (prettyText (identifierName op ^. S.nameConcrete)), + _infixIsDelimiter = isDelimiterStr (prettyText (op ^. scopedIden . S.nameConcrete)), _infixOp = ApeLeafExpression (ExpressionIdentifier op) } @@ -2361,6 +2357,14 @@ judocExamples (Judoc bs) = concatMap goGroup bs JudocExample e -> [e] _ -> mempty +instance HasLoc Alias where + getLoc = (^. aliasName . S.nameDefined) + +instance HasLoc PreSymbolEntry where + getLoc = \case + PreSymbolAlias a -> getLoc a + PreSymbolFinal a -> getLoc a + instance HasLoc SymbolEntry where getLoc = (^. symbolEntry . S.nameDefined) @@ -2386,7 +2390,7 @@ exportAllNames :: SimpleFold ExportInfo (S.Name' ()) exportAllNames = exportSymbols . each - . symbolEntry + . preSymbolName <> exportModuleSymbols . each . moduleEntry @@ -2404,3 +2408,29 @@ _ConstructorRhsRecord :: Traversal' (ConstructorRhs s) (RhsRecord s) _ConstructorRhsRecord f rhs = case rhs of ConstructorRhsRecord r -> ConstructorRhsRecord <$> f r _ -> pure rhs + +_DefinitionSyntax :: Traversal' (Definition s) (SyntaxDef s) +_DefinitionSyntax f x = case x of + DefinitionSyntax r -> DefinitionSyntax <$> f r + _ -> pure x + +_SyntaxAlias :: Traversal' (SyntaxDef s) (AliasDef s) +_SyntaxAlias f x = case x of + SyntaxAlias r -> SyntaxAlias <$> f r + _ -> pure x + +instance HasFixity PostfixApplication where + getFixity (PostfixApplication _ op) = fromMaybe impossible (op ^. scopedIden . S.nameFixity) + +instance HasFixity InfixApplication where + getFixity (InfixApplication _ op _) = fromMaybe impossible (op ^. scopedIden . S.nameFixity) + +-- preSymbolFinal :: Lens' PreSymbolEntry SymbolEntry +-- preSymbolFinal f = \case +-- PreSymbolAlias a -> PreSymbolAlias <$> traverseOf aliasEntry (preSymbolFinal f) a +-- PreSymbolFinal a -> PreSymbolFinal <$> f a + +preSymbolName :: Lens' PreSymbolEntry (S.Name' ()) +preSymbolName f = \case + PreSymbolAlias a -> PreSymbolAlias <$> traverseOf aliasName f a + PreSymbolFinal a -> PreSymbolFinal <$> traverseOf symbolEntry f a diff --git a/src/Juvix/Compiler/Concrete/Print/Base.hs b/src/Juvix/Compiler/Concrete/Print/Base.hs index 5d72342b71..41759ca114 100644 --- a/src/Juvix/Compiler/Concrete/Print/Base.hs +++ b/src/Juvix/Compiler/Concrete/Print/Base.hs @@ -427,8 +427,8 @@ instance SingI s => PrettyPrint (Import s) where instance SingI s => PrettyPrint (AliasDef s) where ppCode AliasDef {..} = - ppCode _aliasSyntaxKw <+> ppCode _aliasAliasKw <+> ppSymbolType _aliasName - <+> ppCode Kw.kwAssign <+> ppIdentifierType _aliasAsName + ppCode _aliasDefSyntaxKw <+> ppCode _aliasDefAliasKw <+> ppSymbolType _aliasDefName + <+> ppCode Kw.kwAssign <+> ppIdentifierType _aliasDefAsName instance SingI s => PrettyPrint (SyntaxDef s) where ppCode = \case @@ -1106,6 +1106,11 @@ instance SingI s => PrettyPrint (Statement s) where StatementAxiom a -> ppCode a StatementProjectionDef a -> ppCode a +instance PrettyPrint PreSymbolEntry where + ppCode = \case + PreSymbolAlias a -> undefined + PreSymbolFinal a -> undefined + instance PrettyPrint SymbolEntry where ppCode ent = noLoc diff --git a/src/Juvix/Compiler/Concrete/Translation/FromParsed/Analysis/Scoping.hs b/src/Juvix/Compiler/Concrete/Translation/FromParsed/Analysis/Scoping.hs index 744931ca19..00b4d2140c 100644 --- a/src/Juvix/Compiler/Concrete/Translation/FromParsed/Analysis/Scoping.hs +++ b/src/Juvix/Compiler/Concrete/Translation/FromParsed/Analysis/Scoping.hs @@ -39,6 +39,7 @@ iniScoperState = _scoperScope = mempty, _scoperSignatures = mempty, _scoperRecordFields = mempty, + _scoperAlias = mempty, _scoperConstructorFields = mempty } @@ -197,7 +198,7 @@ reserveSymbolSignatureOf :: Sem r S.Symbol reserveSymbolSignatureOf k d s = do sig <- mkNameSignature d - reserveSymbolOf k (Just sig) s + reserveSymbolOf False k (Just sig) s reserveSymbolOf :: forall (nameKind :: NameKind) (ns :: NameSpace) r. @@ -205,11 +206,12 @@ reserveSymbolOf :: ns ~ NameKindNameSpace nameKind, SingI ns ) => + Bool -> Sing nameKind -> Maybe NameSignature -> Symbol -> Sem r S.Symbol -reserveSymbolOf k nameSig s = do +reserveSymbolOf isAlias k nameSig s = do checkNotBound path <- gets (^. scopePath) strat <- ask @@ -217,11 +219,15 @@ reserveSymbolOf k nameSig s = do whenJust nameSig (modify' . set (scoperSignatures . at (s' ^. S.nameId)) . Just) modify (set (scopeNameSpaceLocal sns . at s) (Just s')) registerName (S.unqualifiedSymbol s') - let entry :: NameSpaceEntryType (NameKindNameSpace nameKind) + let + u = S.unConcrete s' + entry :: NameSpaceEntryType (NameKindNameSpace nameKind) entry = - let symE = SymbolEntry (S.unConcrete s') - modE = ModuleSymbolEntry (S.unConcrete s') - fixE = FixitySymbolEntry (S.unConcrete s') + let symE + | isAlias = PreSymbolAlias (Alias u) + | otherwise = PreSymbolFinal (SymbolEntry u) + modE = ModuleSymbolEntry u + fixE = FixitySymbolEntry u in case k of SKNameConstructor -> symE SKNameInductive -> symE @@ -272,7 +278,7 @@ bindVariableSymbol :: Members '[Error ScoperError, NameIdGen, State Scope, InfoTableBuilder, State ScoperState] r => Symbol -> Sem r S.Symbol -bindVariableSymbol = localBindings . ignoreSyntax . reserveSymbolOf SKNameLocal Nothing +bindVariableSymbol = localBindings . ignoreSyntax . reserveSymbolOf False SKNameLocal Nothing reserveInductiveSymbol :: Members '[Error ScoperError, NameIdGen, State ScoperSyntax, State Scope, State ScoperState, Reader BindingStrategy, InfoTableBuilder] r => @@ -284,7 +290,7 @@ reserveProjectionSymbol :: Members '[Error ScoperError, NameIdGen, State ScoperSyntax, State Scope, Reader BindingStrategy, InfoTableBuilder, State ScoperState] r => ProjectionDef 'Parsed -> Sem r S.Symbol -reserveProjectionSymbol d = reserveSymbolOf SKNameFunction Nothing (d ^. projectionField) +reserveProjectionSymbol d = reserveSymbolOf False SKNameFunction Nothing (d ^. projectionField) reserveConstructorSymbol :: Members '[Error ScoperError, NameIdGen, State ScoperSyntax, State Scope, State ScoperState, Reader BindingStrategy, InfoTableBuilder] r => @@ -407,7 +413,7 @@ getModuleExportInfo m = fromMaybeM err (gets (^? scoperModules . at (m ^. module -- | Do not call directly. Looks for a symbol in (possibly) nested local modules lookupSymbolAux :: forall r. - Members '[State ScoperState, State Scope, Output ModuleSymbolEntry, Output SymbolEntry, Output FixitySymbolEntry] r => + Members '[State ScoperState, State Scope, Output ModuleSymbolEntry, Output PreSymbolEntry, Output FixitySymbolEntry] r => [Symbol] -> Symbol -> Sem r () @@ -467,7 +473,7 @@ lookupQualifiedSymbol :: forall r. Members '[State Scope, State ScoperState] r => ([Symbol], Symbol) -> - Sem r ([SymbolEntry], [ModuleSymbolEntry], [FixitySymbolEntry]) + Sem r ([PreSymbolEntry], [ModuleSymbolEntry], [FixitySymbolEntry]) lookupQualifiedSymbol sms = do (es, (ms, fs)) <- runOutputList $ runOutputList $ execOutputList $ go sms return (es, ms, fs) @@ -507,12 +513,19 @@ lookupQualifiedSymbol sms = do ref <- toList t ] +-- | This assumes that alias do not have cycles. +normalizePreSymbolEntry :: Members '[State ScoperState] r => PreSymbolEntry -> Sem r SymbolEntry +normalizePreSymbolEntry = \case + PreSymbolFinal a -> return a + PreSymbolAlias a -> gets (^?! scoperAlias . at (a ^. aliasName . S.nameId) . _Just) >>= normalizePreSymbolEntry + checkQualifiedExpr :: (Members '[Error ScoperError, State Scope, State ScoperState, InfoTableBuilder] r) => QualifiedName -> Sem r ScopedIden checkQualifiedExpr q@(QualifiedName (SymbolPath p) sym) = do es <- fst3 <$> lookupQualifiedSymbol (toList p, sym) + -- TODO handle aliases case es of [] -> notInScope [e] -> entryToScopedIden q' e @@ -521,12 +534,19 @@ checkQualifiedExpr q@(QualifiedName (SymbolPath p) sym) = do q' = NameQualified q notInScope = throw (ErrQualSymNotInScope (QualSymNotInScope q)) -entryToScopedIden :: Members '[InfoTableBuilder] r => Name -> SymbolEntry -> Sem r ScopedIden +entryToScopedIden :: Members '[InfoTableBuilder, State ScoperState] r => + Name -> PreSymbolEntry -> Sem r ScopedIden entryToScopedIden name e = do let scopedName :: S.Name - scopedName = set S.nameConcrete name (e ^. symbolEntry) + scopedName = set S.nameConcrete name (e ^. preSymbolName) + si <- case e of + PreSymbolFinal f -> return ScopedIden { + _scopedIden = set S.nameConcrete name (f ^. symbolEntry), + _scopedIdenAlias = Nothing + } + PreSymbolAlias {} -> undefined registerName scopedName - return (ScopedIden (set S.nameConcrete name (e ^. symbolEntry))) + return si -- | We gather all symbols which have been defined or marked to be public in the given scope. exportScope :: @@ -605,7 +625,7 @@ resolveFixitySyntaxDef :: FixitySyntaxDef 'Parsed -> Sem r () resolveFixitySyntaxDef fdef@FixitySyntaxDef {..} = topBindings $ do - sym <- reserveSymbolOf SKNameFixity Nothing _fixitySymbol + sym <- reserveSymbolOf False SKNameFixity Nothing _fixitySymbol let loc = getLoc _fixityInfo fi = _fixityInfo ^. withLocParam . withSourceValue same <- checkMaybeFixity loc $ fi ^. FI.fixityPrecSame @@ -1121,6 +1141,7 @@ checkSections sec = do goDefinitions :: DefinitionsSection 'Parsed -> Sem r' (DefinitionsSection 'Scoped) goDefinitions DefinitionsSection {..} = do mapM_ reserveDefinition _definitionsSection + mapM_ scanAlias (_definitionsSection ^.. each . _DefinitionSyntax . _SyntaxAlias) sec' <- mapM goDefinition _definitionsSection next' <- mapM goNonDefinitions _definitionsNext return @@ -1129,11 +1150,14 @@ checkSections sec = do _definitionsSection = sec' } where + scanAlias :: AliasDef 'Parsed -> Sem r' () + scanAlias = undefined + reserveDefinition :: Definition 'Parsed -> Sem r' () reserveDefinition = \case DefinitionSyntax s -> resolveSyntaxDef s DefinitionFunctionDef d -> void (reserveFunctionSymbol d) - DefinitionTypeSignature d -> void (reserveSymbolOf SKNameFunction Nothing (d ^. sigName)) + DefinitionTypeSignature d -> void (reserveSymbolOf False SKNameFunction Nothing (d ^. sigName)) DefinitionAxiom d -> void (reserveAxiomSymbol d) DefinitionProjectionDef d -> void (reserveProjectionSymbol d) DefinitionInductive d -> reserveInductive d @@ -1286,7 +1310,7 @@ reserveLocalModuleSymbol :: Symbol -> Sem r S.Symbol reserveLocalModuleSymbol = - ignoreSyntax . reserveSymbolOf SKNameLocalModule Nothing + ignoreSyntax . reserveSymbolOf False SKNameLocalModule Nothing checkLocalModule :: forall r. @@ -1697,7 +1721,10 @@ checkRecordPattern :: Sem r (RecordPattern 'Scoped) checkRecordPattern r = do c' <- getNameOfKind KNameConstructor (r ^. recordPatternConstructor) - let s = ScopedIden c' + let s = ScopedIden { + _scopedIden = c', + _scopedIdenAlias = undefined + } fields <- fromMaybeM (return (RecordNameSignature mempty)) (gets (^. scoperConstructorFields . at (c' ^. S.nameId))) l' <- if @@ -1882,6 +1909,7 @@ checkUnqualified s = do scope <- get -- Lookup at the global scope entries <- fst3 <$> lookupQualifiedSymbol ([], s) + -- TODO handle aliases case resolveShadowing entries of [] -> throw (ErrSymNotInScope (NotInScope s scope)) [x] -> entryToScopedIden n x @@ -1900,7 +1928,7 @@ checkFixitySymbol s = do case resolveShadowing entries of [] -> throw (ErrSymNotInScope (NotInScope s scope)) [x] -> return $ entryToSymbol x s - es -> throw (ErrAmbiguousSym (AmbiguousSym n (map (SymbolEntry . (^. fixityEntry)) es))) + es -> throw (ErrAmbiguousSym (AmbiguousSym n (map (PreSymbolFinal . SymbolEntry . (^. fixityEntry)) es))) where n = NameUnqualified s @@ -1970,6 +1998,7 @@ lookupNameOfKind :: Name -> Sem r (Maybe S.Name) lookupNameOfKind nameKind n = do + -- TODO handle alias entries <- mapMaybe filterEntry . fst3 <$> lookupQualifiedSymbol (path, sym) case entries of [] -> return Nothing @@ -2140,7 +2169,7 @@ checkIterator :: Sem r (Iterator 'Scoped) checkIterator iter = do _iteratorName <- checkName (iter ^. iteratorName) - case identifierName _iteratorName ^. S.nameIterator of + case _iteratorName ^. scopedIden . S.nameIterator of Just IteratorAttribs {..} -> do case _iteratorAttribsInitNum of Just n @@ -2408,7 +2437,7 @@ makeExpressionTable (ExpressionAtoms atoms _) = [recordUpdate] : [appOpExplicit] AssocNone -> P.InfixN | otherwise = Nothing where - S.Name' {..} = identifierName iden + S.Name' {..} = iden ^. scopedIden parseSymbolId :: S.NameId -> Parse ScopedIden parseSymbolId uid = P.token getIdentifierWithId mempty @@ -2416,7 +2445,7 @@ makeExpressionTable (ExpressionAtoms atoms _) = [recordUpdate] : [appOpExplicit] getIdentifierWithId :: ExpressionAtom 'Scoped -> Maybe ScopedIden getIdentifierWithId s = case s of AtomIdentifier iden - | uid == identifierName iden ^. S.nameId -> Just iden + | uid == iden ^. scopedIden . S.nameId -> Just iden _ -> Nothing recordUpdate :: P.Operator Parse Expression @@ -2603,7 +2632,7 @@ parseTerm = identifierNoFixity :: ExpressionAtom 'Scoped -> Maybe ScopedIden identifierNoFixity s = case s of AtomIdentifier iden - | not (S.hasFixity (identifierName iden)) -> Just iden + | not (S.hasFixity (iden ^. scopedIden)) -> Just iden _ -> Nothing parseBraces :: Parse Expression diff --git a/src/Juvix/Compiler/Concrete/Translation/FromParsed/Analysis/Scoping/Error/Types.hs b/src/Juvix/Compiler/Concrete/Translation/FromParsed/Analysis/Scoping/Error/Types.hs index d2057311c5..3341d3c9ec 100644 --- a/src/Juvix/Compiler/Concrete/Translation/FromParsed/Analysis/Scoping/Error/Types.hs +++ b/src/Juvix/Compiler/Concrete/Translation/FromParsed/Analysis/Scoping/Error/Types.hs @@ -286,7 +286,7 @@ instance ToGenericError DuplicateIterator where locs = vsep $ map (pretty . getLoc) [_dupIteratorFirst, _dupIteratorFirst] data ExportEntries - = ExportEntriesSymbols (NonEmpty SymbolEntry) + = ExportEntriesSymbols (NonEmpty PreSymbolEntry) | ExportEntriesModules (NonEmpty ModuleSymbolEntry) | ExportEntriesFixities (NonEmpty FixitySymbolEntry) deriving stock (Show) @@ -459,7 +459,7 @@ instance ToGenericError UnusedIteratorDef where data AmbiguousSym = AmbiguousSym { _ambiguousSymName :: Name, - _ambiguousSymEntires :: [SymbolEntry] + _ambiguousSymEntires :: [PreSymbolEntry] } deriving stock (Show)