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
For this one I was thinking of this simple change in Parser.h line 235:
unique p = do
fields' <- p
case findDuplicates fields' fieldOrdinal ++ findDuplicates fields' fieldName of
[] -> return fields'
Field {..}:_ -> fail $ "Duplicate definition of the field with ordinal " ++ show fieldOrdinal ++
" and field name " ++ show fieldName
where
findDuplicates xs ft = deleteFirstsBy (ordinal ft) xs (nubBy (ordinal ft) xs)
ordinal ft = (==) `on` ft
The bad thing is that the error message will display both values as possible duplications when only one is duplicated. If we want a more specific error message for each case I can refactor it in some other way that allows this.
The following .bond file should fail
gbc
code generation, as it contains two fields with the same name.However, Bond Compiler 0.4.0.1 accepts this .bond file and generates C++ and C# code that does not compile.
Here's an excerpt of the generated C# code.
The text was updated successfully, but these errors were encountered: