Fixed a type error in teh codegen.
This commit is contained in:
parent
4e92f86d60
commit
ebac869761
1 changed files with 5 additions and 5 deletions
|
|
@ -79,8 +79,8 @@ getFunctions bs = Map.fromList $ go bs
|
||||||
( \(Constructor id xs) ->
|
( \(Constructor id xs) ->
|
||||||
( (coerce id, MIR.TLit (extractTypeName n))
|
( (coerce id, MIR.TLit (extractTypeName n))
|
||||||
, FunctionInfo
|
, FunctionInfo
|
||||||
{ numArgs = length xs
|
{ numArgs = length (flattenType xs)
|
||||||
, arguments = createArgs (snd <$> xs)
|
, arguments = createArgs (flattenType xs)
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
@ -105,8 +105,8 @@ getConstructors bs = Map.fromList $ go bs
|
||||||
( \(acc, i) (Constructor (GA.Ident id) xs) ->
|
( \(acc, i) (Constructor (GA.Ident id) xs) ->
|
||||||
( ( (GA.Ident (n <> "_" <> id), MIR.TLit (coerce n))
|
( ( (GA.Ident (n <> "_" <> id), MIR.TLit (coerce n))
|
||||||
, ConstructorInfo
|
, ConstructorInfo
|
||||||
{ numArgsCI = length xs
|
{ numArgsCI = length (flattenType xs)
|
||||||
, argumentsCI = createArgs (snd <$> xs)
|
, argumentsCI = createArgs (flattenType xs)
|
||||||
, numCI = i
|
, numCI = i
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
@ -267,7 +267,7 @@ compileScs (MIR.DData (MIR.Data typ ts) : xs) = do
|
||||||
emit $ LIR.Type (Ident outer_id) [I8, Array biggestVariant I8]
|
emit $ LIR.Type (Ident outer_id) [I8, Array biggestVariant I8]
|
||||||
mapM_
|
mapM_
|
||||||
( \(Constructor (GA.Ident inner_id) fi) -> do
|
( \(Constructor (GA.Ident inner_id) fi) -> do
|
||||||
emit $ LIR.Type (GA.Ident $ outer_id <> "_" <> inner_id) (I8 : map type2LlvmType (snd <$> fi))
|
emit $ LIR.Type (GA.Ident $ outer_id <> "_" <> inner_id) (I8 : map type2LlvmType (flattenType fi))
|
||||||
)
|
)
|
||||||
ts
|
ts
|
||||||
compileScs xs
|
compileScs xs
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue