Git Product home page Git Product logo

automagic's People

Contributors

cb372 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

automagic's Issues

Fix sbt warnings

[warn] /Users/chris/code/automagic/project/Build.scala:50: `<<=` operator is deprecated. Use `key := { x.value }` or `key ~= (old => { newValue })`.
[warn] See http://www.scala-sbt.org/0.13/docs/Migrating-from-sbt-012x.html
[warn]     publishTo <<= version { v =>
[warn]               ^
[warn] /Users/chris/code/automagic/project/Build.scala:21: `<+=` operator is deprecated. Try `lhs += { x.value }`
[warn]   or see http://www.scala-sbt.org/0.13/docs/Migrating-from-sbt-012x.html.
[warn]       libraryDependencies <+= scalaVersion { s =>
[warn]                           ^
[warn] /Users/chris/code/automagic/project/Build.scala:9: trait Build in package sbt is deprecated: Use .sbt format instead
[warn] object AutomagicBuild extends Build {
[warn]                               ^
[warn] three warnings found

Release v0.2

Would you mind pushing the latest updates to Maven?

Cannot transform to a final case class defined in a trait

I'm not sure of the actual problem here, but I'm trying to transform to a database row and getting this error when I try to transform:

type mismatch;
[error]  found   : Tables.this.UserRow
[error]  required: my.project.TablesImpl.UserRow
[error]   def toRow(user: User): UserRow = transform[User, UserRow](user,

This is my implementation:

import my.project.TablesImpl.UserRow
def toRow(user: User): UserRow = transform[User, UserRow](user)

Tables is a (generated) trait with final case classes defined inside it (e.g., UserRow), and lives inside target/scala-2.11/src_managed/main. TablesImpl is an object I've defined that extends this trait, but has nothing defined inside it.

TablesImpl.scala:

object TablesImpl extends {
  val profile = slick.jdbc.MySQLProfile
} with Tables

Tables.scala (generated by slick):

object Tables extends {
  val profile = slick.jdbc.MySQLProfile
} with Tables
trait Tables {
  val profile: slick.jdbc.JdbcProfile
  ...
  final case class UserRow(id: String, ...)
}

Could anyone shed any light on what this error message means? This was working fine until the UserRow case class moved inside the trait, rather than being defined in the same file outside of the trait scope. Is it not possible to transform to a class defined in a trait? Is it something to do with it being final?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.