Skip to content

Commit c89bc99

Browse files
committed
A commit which breaks the compiler
1 parent ded5d35 commit c89bc99

33 files changed

+2227
-1862
lines changed

build.sbt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ libraryDependencies ++= Seq(
3333

3434
scalacOptions ++= Seq(
3535
// "-Ylog-classpath",
36-
// "-Xlog-implicits",
37-
"-explaintypes",
36+
"-Xlog-implicits",
3837
"-Wconf:cat=deprecation&msg=foldLeft:silent,cat=deprecation&msg=foldRight:silent,cat=deprecation:w,cat=feature:w",
3938
"-language:implicitConversions",
4039
"-language:higherKinds",

src/main/scala/net/noresttherein/oldsql/OperationType.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ sealed trait OperationType {
3737
val nonDefault :FlagBuffType
3838

3939
/** A buff marking that a column/component must be included in the operation explicitly, as it is not included
40-
* by the mapping in the standard process. Example: `ExplicitSelect` for CLOB/BLOB types. This column implies
40+
* by the mapping in the standard process. Example: `ExplicitSelect` for CLOB/BLOB types. This buff implies
4141
* [[net.noresttherein.oldsql.OperationType.optional optional]] and
4242
* [[net.noresttherein.oldsql.OperationType.nonDefault nonDefault]].
4343
*/

src/main/scala/net/noresttherein/oldsql/hoard/Pile.scala

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ trait Pile[T] { pile =>
3030
case e :Exception => try {
3131
session.close()
3232
throw e
33-
} finally {throw e }
33+
} catch {
34+
case e1 :Throwable => e.addSuppressed(e1); throw e
35+
}
3436
}
3537
}
3638

src/main/scala/net/noresttherein/oldsql/model/ComposedOf.scala

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,9 @@ import net.noresttherein.oldsql.model.ComposedOf.{Arity, ComposableFrom, Decompo
66
import net.noresttherein.oldsql.model.ComposedOf.ComposableFrom.{Collection, Custom}
77
import net.noresttherein.oldsql.slang._
88

9-
//todo: implicits for immutable.Iterable and immutable.Map
9+
10+
11+
1012

1113

1214

@@ -171,7 +173,7 @@ object ComposedOf {
171173

172174

173175
/** An implicit witness that type `C` is strictly composed of a variable or multiple number of values of type `E`.
174-
* This particularly excludes instances of `C ComposedOf E` so that operations which either make no sense or can
176+
* This particularly excludes instances of `E ComposedOf E` so that operations which either make no sense or can
175177
* be misleading when dealing with singleton values can require a `C CollectionOf E` instead of the more generic
176178
* `C ComposedOf E`.
177179
*/

src/main/scala/net/noresttherein/oldsql/model/InvocationReflection.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ private[model] object InvocationReflection {
157157

158158

159159
private def mock(subjectType :Type) :Any = {
160-
val subjectClass = classFor(subjectType) //todo: maybe it _can_ extend final classes?
160+
val subjectClass = classFor(subjectType)
161161
if (!subjectClass.isPrimitive && (subjectClass.getModifiers & FINAL) == 0)
162162
tracer(subjectType, subjectClass)
163163
else

src/main/scala/net/noresttherein/oldsql/model/Restraint.scala

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import net.noresttherein.oldsql.slang._
2525
* treated as a result set of values of `T`, because then it would have to be covariant with regards to `T` -
2626
* a set of values of `S` is of course a set of values of `T>:S`. This becomes an issue when used inside a
2727
* `Kin[T]`, which is covariant with regards to `T` and care has to be taken when dealing with such cases.
28-
*/
28+
*/ //consider: renaming to Selection
2929
trait Restraint[-T] extends (T => Boolean) with scala.Equals with Serializable with implicits {
3030

3131
/** Creates a restraint implementing the negated condition of this restraint (i.e. selecting a value ''iff''
@@ -130,7 +130,7 @@ object Restraint {
130130
def compose[K](oldKey :P=>K, newKey :K=>P) :Restrainer[T, K] =
131131
new MappedRestrainer[T, P, K](this)(oldKey, newKey)
132132

133-
/** Create a restrainer working on some other, larger type `X` from which values of `S<:T` can be derived. */
133+
/** Create a restrainer working on some other, larger type `X` from which values of `S <: T` can be derived. */
134134
def derive[X, S<:T](nest :Restrictive[X, S]) :Restrainer[X, P] = new NestedRestrainer(this, nest)
135135

136136
def canEqual(that :Any) :Boolean = that.isInstanceOf[Restrainer[_, _]]
@@ -735,7 +735,8 @@ object Restraint {
735735

736736

737737
/** Check if the given restriction is a membership test for a set. */
738-
def unapply[T](restraint :Restraint[T]) :Option[(Restrictive[T, E], Restrictive[T, C], C DecomposableTo E) forSome { type E; type C }] =
738+
def unapply[T](restraint :Restraint[T])
739+
:Option[(Restrictive[T, E], Restrictive[T, C], C DecomposableTo E) forSome { type E; type C }] =
739740
restraint match {
740741
case m :MembershipTest[T, c, e] => Some((m.member, m.values, m.decomposer))
741742
// case Equal(left, right) => Some((left, right, DecomposableTo.Subclass()))
@@ -771,7 +772,7 @@ object Restraint {
771772
items.collect { case Literal(v) => v.asInstanceOf[K] }.toSet providing (_.size == items.size)
772773

773774
case Membership(Term, Literal(items), deco) =>
774-
//todo: wrong! may be Iterable[Set[K]] after decomposer
775+
//todo: wrong! may be Iterable[Set[K]] after decomposition
775776
Some(deco.asInstanceOf[DecomposableTo[Any, Any]].apply(items).toSet.asInstanceOf[Set[K]])
776777

777778
case False => Some(Set.empty)

src/main/scala/net/noresttherein/oldsql/model/Restrictive.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ import scala.reflect.runtime.universe
2323
* where `T` is some constrained entity. Instances of this type are typically tested with a predicate
2424
* or compared with other instances to produce Boolean conditions.
2525
* @see [[net.noresttherein.oldsql.model.Restraint.Restrainer Restrainer]]
26-
*/ //todo: awkward name, think of something better
26+
*/ //todo: awkward name, think of something better. Selector?
2727
sealed trait Restrictive[-T, V] extends TranslableTerm[T, V] with Serializable with implicits {
2828
//todo: def apply(whole :T) :V and self type to T => V. If only private classes implement T => V,
2929
// it will not count as an implicit conversion.

src/main/scala/net/noresttherein/oldsql/schema/ColumnMapping.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -262,7 +262,7 @@ sealed abstract class LowPriorityColumnMappingImplicits {
262262
(implicit subject :C <:< ColumnMapping[S, O], origin :F <:< O,
263263
offset :TableCount[O, _ <: Numeral],
264264
projection :OriginProjection[C, S] { type WithOrigin[A] <: ColumnMapping[S, A] })
265-
:ColumnSQL[F, GlobalScope, S] =
265+
:LooseColumnComponent[F, projection.WithOrigin, S] =
266266
LooseColumnComponent(projection[F](column), offset.tables)
267267

268268
}

src/main/scala/net/noresttherein/oldsql/schema/Mapping.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,7 @@ trait Mapping {
872872

873873
/** The SQL/DDL-related name associated with this mapping. This must be defined for all column and table
874874
* mappings, but is typically empty in all other cases.
875-
*/ //consider: removing this altogether, probably once we've implemented actutal table schema
875+
*/ //consider: removing this altogether, probably once we've implemented actual table schema
876876
def sqlName :Option[String] = None
877877

878878

@@ -1730,7 +1730,7 @@ object Mapping extends LowPriorityMappingImplicits {
17301730
s"Can't create a $op write form for $mapping using $exports: ${op.prohibited} buff present among selection."
17311731
)
17321732

1733-
val columns = exports.flatMap { //fixme: adding an ExplicitXxx buff to a column with the
1733+
val columns = exports.flatMap { //fixme: adding an ExplicitXxx buff to excluded columns with the OptionalXxx
17341734
c => c.columns.toSeq.map(mapping.export(_)).filter(op.prohibited.disabled)
17351735
}.toUnique
17361736
val mandatory = mapping.columns.filter(op.nonDefault.disabled)

src/main/scala/net/noresttherein/oldsql/schema/MappingSchema.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ trait MappingSchema[S, V <: Chain, C <: Chain, O] extends BaseMapping[V, O] with
6464
override type Unpacked = V
6565

6666
//fixme: C might omit mandatory components! schema.forSelect(...).forUpdate(...) can exclude a component necessary
67-
// for update, but not select. We need special subclasses SelectSchema
67+
// for update, but not select. We need special subclasses SelectSchema or perhaps better, a SchemaForm.
6868
override type Components = C
6969

7070
/** The `Subject` type of the outer mapping to which this schema belongs. */

src/main/scala/net/noresttherein/oldsql/schema/Relation.scala

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,13 +97,14 @@ object Relation {
9797
* accepting the `Origin` type for use in `FromClause` subclasses and other types accepting such a type constructor:
9898
* `Dual Join (Humans As "humans")#T` (where `Humans[O] <: MappingAt[O]`).
9999
* @see [[net.noresttherein.oldsql.schema.bits.LabeledMapping.@:]]
100-
*/
100+
*/ //
101101
class As[M[O] <: MappingAt[O], A <: Label](val relation :Relation[M], val alias :A)
102102
extends NamedRelation[A, ({ type T[O] = A @: M[O] })#T]
103-
{
103+
{ //todo: the contract of name/sql must be specified here; is alias a part of sql?
104104
type T[O] = A @: M[O]
105105

106106
override def name :A = alias
107+
override def sql :String = relation.sql
107108

108109
override def apply[O] :A @: M[O] =
109110
(alias @: relation[O].asInstanceOf[RefinedMapping[Any, Any]]).asInstanceOf[A @: M[O]]

src/main/scala/net/noresttherein/oldsql/schema/bits/MappedMapping.scala

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ object MappedMapping {
159159

160160
def adapter[M <: MappingAt[O], T, S, O](mapping :MappingAdapter[M, T, O], mapped: T =?> S, unmapped :S =?> T)
161161
(implicit nulls :NullValue[S] = null) :M MappedTo S =
162-
new MappedAdapter[M, T, S, O](mapping, mapped, unmapped)
162+
new MappedAdapterAdapter[M, T, S, O](mapping, mapped, unmapped)
163163

164164
def mapAdapter[M <: MappingAt[O], T, S, O](mapping :MappingAdapter[M, T, O], mapped :T => S, unmapped :S => T)
165165
(implicit nulls :NullValue[S] = null) :M MappedTo S =
@@ -186,10 +186,10 @@ object MappedMapping {
186186

187187

188188

189-
private class MappedAdapter[+M <: MappingAt[O], T, S, O]
190-
(protected override val backer :MappingAdapter[M, T, O],
191-
protected override val map :T =?> S, protected override val unmap :S =?> T)
192-
(implicit protected override val nulls :NullValue[S] = null)
189+
private class MappedAdapterAdapter[+M <: MappingAt[O], T, S, O]
190+
(protected override val backer :MappingAdapter[M, T, O],
191+
protected override val map :T =?> S, protected override val unmap :S =?> T)
192+
(implicit protected override val nulls :NullValue[S] = null)
193193
extends MappedMapping[T, S, O] with ComposedAdapter[M, T, S, O]
194194
{
195195
override def as[X](there :S =?> X, back :X =?> S)(implicit nulls :NullValue[X]) :MappingAdapter[M, X, O] =

src/main/scala/net/noresttherein/oldsql/sql/Alias.scala

Lines changed: 0 additions & 90 deletions
This file was deleted.

0 commit comments

Comments
 (0)