anz-bank / sysl

Sysl (pronounced "sizzle") is a system specification language
https://sysl.io
Apache License 2.0
122 stars 42 forks source link

Go code generator variable 'model' conflicts if SYSL model has a field named 'model' #1074

Open alextmz opened 3 years ago

alextmz commented 3 years ago

Description

Not sure if my usage is up to date or correct, so let me know if not. When using the branch anzdaddy/relgom, the Go code generated can be invalid (not compilable) due to a naming conflict if the SYSL model used has a field of name 'model':

!table something:
      model <: something

Can provide more details in private. There is a write-up ready that cannot be posted here.

Steps to Reproduce

  1. Have a model with a field named 'model'
  2. Generate Go code using branch anzdaddy/relgom
  3. Try to compile the code - type mismatch errors are thrown

Expected behavior

Compilation successful

Actual behavior

Compilation fails - type mismatch errors are thrown