Please sign in to comment.
Infer correct NominalType views even without the NominalType.
In inferTypes, we used to replace structural views of NominalTypes after constructing all table types. At that point, however, type inference (which runs before table types can be determined) may have copied a structural view on its own (without the enclosing NominalType) into another type. For instance, this happens in the typing of GroupBy, where the "by" type needs to be copied purely as a structural view. In these cases the resulting NoType could not be patched to the correct type. To fix this problem we use the new type UnassignedStructuralType(ts) with the same TypeSymbol as the surrounding NominalType in table types, which can be patched even after the NominalType has been lost. The only remaining use of NoType in StarAnd can be replaced by UnassignedType, thus eliminating NoType entirely. Tests in AggregateTest.testGroupBy. Fixes issue #252.
- Loading branch information
Showing with 21 additions and 6 deletions.
- +13 −0 slick-testkit/src/main/scala/com/typesafe/slick/testkit/tests/AggregateTest.scala
- +1 −1 src/main/scala/scala/slick/ast/Node.scala
- +5 −2 src/main/scala/scala/slick/ast/Type.scala
- +1 −2 src/main/scala/scala/slick/compiler/InferTypes.scala
- +1 −1 src/main/scala/scala/slick/driver/JdbcStatementBuilderComponent.scala