Closed kazu-yamamoto closed 9 years ago
The "type" is derived from a column name of the "Tabconst" table.
GHC prior to 7.10 permitted a record field to have a name that has a collision with the reserved identifiers in Haskell if the field are generated by TH. We cannot use such a record field without qualifier, but in writing code with HRR, we always use it with qualified name. That restriction was not a problem.
GHC 7.10 got not to permit such record fields even derived from TH. If a database table has a column that is the same name with a reserved identifier, compilation error occurs.
HRR has to rename automatically, or has to provide an interface so that programmer can change to arbitrary name.
https://github.com/ghc/ghc/blob/ghc-7.8/compiler/hsSyn/Convert.lhs#L1058 https://github.com/ghc/ghc/blob/ghc-7.10/compiler/hsSyn/Convert.hs#L1142 https://github.com/ghc/ghc/blob/ghc-7.10/compiler/basicTypes/Lexeme.hs#L118
I committed the code to enable GHC 7.10.1 compile relational-schemas. This simply rename variables that conflict with the reserved identifiers.
Refer the following commits in ghc-710 branch. a8557ee05a857dbcd05dc0e777429702336be9d2 a59267ce2c9e52b1c8c4369b1b453e69d9eb3372
Confirmed. Let's release new versions.
@khibino Is this fix acceptable to you? If so, I will merge it with master branch and bump up version of names-th.
Let's release the next version ASAP.
Merged this fix. Thanks!
This is fixed version. http://hackage.haskell.org/package/names-th-0.1.0.1