You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
type R = {a: U32, b: U32} layout record {a: 4B at 0B }
f: R -> R
f x = x{a=5}
compiles successfully but creates a C datatype
struct t1 { unsigned int data[1U]; } ;
i.e., the b field is silently ignored.
When the field is used afterwards, the compiler crashes:
type R = {a: U32, b: U32} layout record {a: 4B at 0B }
f: R -> R
f x = x{a=5,b=7}
causes the error message
cogent -g put-nonlayout-field.cogent
Parsing...
Resolving dependencies...
Typechecking...
Desugaring and typing...
Normalising...ANF
Re-typing NF...
Simplifying...
Skipped
Monomorphising...
Re-typing monomorphic AST...
Generating C code...
> Writing to file: ./put-nonlayout-field.h
cogent: Map.!: given key is not an element in the map
CallStack (from HasCallStack):
error, called at libraries/containers/Data/Map/Internal.hs:610:17 in containers-0.6.0.1:Data.Map.Internal
The text was updated successfully, but these errors were encountered:
The code
compiles successfully but creates a C datatype
i.e., the b field is silently ignored.
When the field is used afterwards, the compiler crashes:
causes the error message
The text was updated successfully, but these errors were encountered: