Skip to content

Commit fc4090f

Browse files
committed
Missed fromSpine
1 parent 9aa0928 commit fc4090f

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

core-tests/tests/generic-deriving/Main.purs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ data A a
1414
= A Number String
1515
| B Int
1616
| C (Array (A a))
17-
| D { a :: a }
17+
| D { "asgård" :: a }
1818
| E Void
1919

2020
derive instance genericA :: (Generic b) => Generic (A b)
@@ -24,4 +24,4 @@ newtype X b = X b
2424
derive instance genericX :: Generic (X String)
2525

2626
main :: forall eff. Eff (console :: CONSOLE | eff) Unit
27-
main = Control.Monad.Eff.Console.log (gShow (D { a: C [ A 1.0 "test", B 42, D { a: true } ] }))
27+
main = Control.Monad.Eff.Console.log (gShow (D { "asgård": C [ A 1.0 "test", B 42, D { "asgård": true } ] }))

src/Language/PureScript/Sugar/TypeClasses/Deriving.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ mkFromSpineFunction mn (DataDeclaration _ _ _ args) = lamCase "$x" <$> (addCatch
170170
mkAlternative :: (ProperName, [Type]) -> m CaseAlternative
171171
mkAlternative (ctorName, tys) = do
172172
idents <- replicateM (length tys) (fmap Ident freshName)
173-
return $ CaseAlternative [ prodBinder [ StringBinder (runProperName ctorName), ArrayBinder (map VarBinder idents)]]
173+
return $ CaseAlternative [ prodBinder [ StringBinder (showQualified runProperName (Qualified (Just mn) ctorName)), ArrayBinder (map VarBinder idents)]]
174174
. Right
175175
$ liftApplicative (mkJust $ Constructor (Qualified (Just mn) ctorName))
176176
(zipWith fromSpineFun (map (Var . Qualified Nothing) idents) tys)

0 commit comments

Comments
 (0)