{"push_id":867940870,"size":1,"distinct_size":1,"ref":"refs/heads/traits-late-fields","head":"cc14f055f0562568c4fbb6c1226128c86e19d97a","before":"9073183294410fb26850897eae210565c00c13a2","commits":[{"sha":"cc14f055f0562568c4fbb6c1226128c86e19d97a","author":{"email":"7639fe603eb93a42390376ac4f0d54260fa6a394@typesafe.com","name":"Adriaan Moors"},"message":"fields phase\n\nthe info-transformed of constructors:\n  - traits receive trait-setters for vals\n  - classes receive fields & accessors for mixed in traits\n\nConstructors tree transformer\n  - makes trees for decls added during above info transform\n  - adds mixin super calls to the primary constructor\n\n```\ntrait OneConcreteVal[T] {\nvar x = 1 // : T = ???\ndef foo = x\n}\n\ntrait OneOtherConcreteVal[T] {\nvar y: T = ???\n}\n\nclass C extends OneConcreteVal[Int] with OneOtherConcreteVal[String]\n```\n\nwe don't have a field -- only a getter -- so,\nwhere will we keep non-getter but-field annotations?\n\nmixin only deals with lazy accessors/vals\n\ndo not used referenced to correlate getter/setter\nit messes with paramaccessor's usage, and we don't really need it\n\nmake sure to clone info's, so we don't share symbols for method args\nthis manifests itself as an exception in lambdalift, finding proxies\n\nUse NEEDS_TREES for all comms between InfoTransform and tree transform\n\nyep, need SYNTHESIZE_IMPL_IN_SUBCLASS\n\ndistinguish accessors that should be mixed into subclass,\nand those that simply need to be implemented in tree transform,\nafter info transform added the decl\n\ncommit 4b4932e800\nAuthor: Adriaan Moors <adriaan.moors@typesafe.com>\nDate:   6 days ago\n\n    do assignment to trait fields in AddInterfaces\n\n    regular class vals get assignments during constructors, as before\n\nimpl classes get accessors + assignments through trait setters in addinterfaces\nso that constructors acts on them there,\nand produced the init method in the required spot (the impl class)\n\nbootstrapped compiler needs new partest\n\ncommit baf568d191\nAuthor: Adriaan Moors <adriaan.moors@typesafe.com>\nDate:   3 weeks ago\n\n    produce identical bytecode for constant trait val getters\n\n    I couldn't bring myself to emit the unused fields that we\n    used to emit for constant vals, even though the getters\n    immediately return the constant, and thus the field goes unused.\n\n    In the next version, there's no need to synthesize impls\n    for these in subclasses -- the getter can be implemented\n    in the interface.\n\ncommit b9052dad44\nAuthor: Lukas Rytz <lukas.rytz@gmail.com>\nDate:   3 weeks ago\n\n    Fix enclosing method attribute for classes nested in trait fields\n\n    Trait fields are now created as MethodSymbol (no longer TermSymbol).\n    This symbol shows up in the `originalOwner` chain of a class declared\n    within the field initializer. This promoted the field getter to\n    being the enclosing method of the nested class, which it is not\n    (the EnclosingMethod attribute is a source-level property).\n\ncommit cf845abed7\nAuthor: Adriaan Moors <adriaan.moors@typesafe.com>\nDate:   3 weeks ago\n\n    don't suppress field for unit-typed vals\n\n    it affects the memory model -- even a write of unit to a field is relevant...\n\ncommit 337a9dd8e6\nAuthor: Adriaan Moors <adriaan.moors@typesafe.com>\nDate:   4 weeks ago\n\n    unit-typed lazy vals should never receive a field\n\n    this need was unmasked by test/files/run/t7843-jsr223-service.scala,\n    which no longer printed the output expected from the `0 to 10 foreach`\n\n    Currently failing tests:\n\n     - test/files/pos/t6780.scala\n     - test/files/neg/anytrait.scala\n     - test/files/neg/delayed-init-ref.scala\n     - test/files/neg/t562.scala\n     - test/files/neg/t6276.scala\n     - test/files/run/delambdafy_uncurry_byname_inline.scala\n     - test/files/run/delambdafy_uncurry_byname_method.scala\n     - test/files/run/delambdafy_uncurry_inline.scala\n     - test/files/run/delambdafy_uncurry_method.scala\n     - test/files/run/inner-obj-auto.scala\n     - test/files/run/lazy-traits.scala\n     - test/files/run/reify_lazyunit.scala\n     - test/files/run/showraw_mods.scala\n     - test/files/run/t3670.scala\n     - test/files/run/t3980.scala\n     - test/files/run/t4047.scala\n     - test/files/run/t6622.scala\n     - test/files/run/t7406.scala\n     - test/files/run/t7843-jsr223-service.scala\n     - test/files/jvm/innerClassAttribute\n     - test/files/specialized/SI-7343.scala\n     - test/files/specialized/constant_lambda.scala\n     - test/files/specialized/spec-early.scala\n     - test/files/specialized/spec-init.scala\n     - test/files/specialized/spec-matrix-new.scala\n     - test/files/specialized/spec-matrix-old.scala\n     - test/files/presentation/scope-completion-3\n\ncommit b1b4e5c0ca\nAuthor: Adriaan Moors <adriaan.moors@typesafe.com>\nDate:   4 weeks ago\n\n    wip: lambdalift fix\n\n    test/files/trait-defaults/lambdalift.scala works,\n    but still some related tests failing\n\n    (note that we can't use a bootstrapped compiler yet\n    due to binary incompatibility in partest)\n\ncommit eae7dacd8c\nAuthor: Adriaan Moors <adriaan.moors@typesafe.com>\nDate:   4 weeks ago\n\n    update check now that trait vals can be concrete, use names not letters\n\n    note the progression in a concrete trait val now being recognized as such\n    ```\n    -trait T => true\n    -method $init$ => false\n    -value z1 => true\n    -value z2 => true // z2 is actually concrete!\n    ```\n\ncommit 6555c7449a\nAuthor: Adriaan Moors <adriaan.moors@typesafe.com>\nDate:   4 weeks ago\n\n    bootstraps again by running info transform once per class...\n\n    not sure how this ever worked, as separate compilation would transform a trait's info\n    multiple times, resulting in double defs...\n\ncommit 273cb209df\nAuthor: Adriaan Moors <adriaan.moors@typesafe.com>\nDate:   6 weeks ago\n\n    skip presuper vals in new encoding\n\ncommit 728e71e061\nAuthor: Adriaan Moors <adriaan.moors@typesafe.com>\nDate:   6 weeks ago\n\n    incoherent cyclic references between synthesized members\n\n    must replace old trait accessor symbols by mixed in symbols\n    in the infos of the mixed in symbols\n\n    ```\n    trait T { val a: String ; val b: a.type }\n    class C extends T {\n      // a, b synthesized, but the a in b's type, a.type, refers to the original symbol, not the clone in C\n    }\n    ```\n\n    symbols occurring in types of synthesized members\n    do not get rebound to other synthesized symbols\n\n    package <empty>#4 {\n      abstract <defaultparam/trait> trait N#7352 extends scala#22.AnyRef#2378 {\n        <method> <deferred> <mutable> <accessor> <triedcooking> <sub_synth> def N$_setter_$self_$eq#15011(x$1#15012: <empty>#3.this.N#7352): scala#23.this.Unit#2340;\n        <method> <deferred> <mutable> <accessor> <triedcooking> <sub_synth> def N$_setter_$n_$eq#15013(x$1#15014: N#7352.this.self#7442.type): scala#23.this.Unit#2340;\n        <method> def /*N*/$init$#7441(): scala#23.this.Unit#2340 = {\n          ()\n        };\n        <method> <deferred> <stable> <accessor> <triedcooking> <sub_synth> def self#7442: <empty>#3.this.N#7352;\n        N#7352.this.N$_setter_$self_$eq#15011(scala#22.Predef#1729.$qmark$qmark$qmark#6917);\n        <method> <deferred> <stable> <accessor> <sub_synth> def n#7443: N#7352.this.self#7442.type;\n        N#7352.this.N$_setter_$n_$eq#15013(N#7352.this.self#7442)\n      };\n      abstract class M#7353 extends scala#22.AnyRef#2378 {\n        <method> <triedcooking> def <init>#13465(): <empty>#3.this.M#7353 = {\n          M#7353.super.<init>#2719();\n          ()\n        };\n        <method> <deferred> <stable> <accessor> <triedcooking> def self#13466: <empty>#3.this.N#7352;\n        <method> <deferred> <stable> <accessor> def n#13467: M#7353.this.self#13466.type\n      };\n      class C#7354 extends M#7353 with <empty>#3.this.N#7352 {\n        <method> <stable> <accessor> <triedcooking> def self#15016: <empty>#3.this.N#7352 = C#7354.this.self #15015;\n        <triedcooking> private[this] val self #15015: <empty>#3.this.N#7352 = _;\n        <method> <stable> <accessor> def n#15018: C#7354.this.self#7442.type = C#7354.this.n #15017;\n        <triedcooking> private[this] val n #15017: C#7354.this.self#7442.type = _;\n        <method> <mutable> <accessor> <triedcooking> def N$_setter_$self_$eq#15019(x$1#15021: <empty>#3.this.N#7352): scala#23.this.Unit#2340 = C#7354.this.self #15015 = x$1#15021;\n        <method> <mutable> <accessor> <triedcooking> def N$_setter_$n_$eq#15022(x$1#15025: C#7354.this.self#7442.type): scala#23.this.Unit#2340 = C#7354.this.n #15017 = x$1#15025;\n        <method> def <init>#14997(): <empty>#3.this.C#7354 = {\n          C#7354.super.<init>#13465();\n          ()\n        }\n      }\n    }\n\n    [running phase pickler on dependent_rebind.scala]\n    [running phase refchecks on dependent_rebind.scala]\n    test/files/trait-defaults/dependent_rebind.scala:16: error: overriding field n#15049 in trait N#7352 of type C#7354.this.self#15016.type;\n     value n #15017 has incompatible type;\n     found   : => C#7354.this.self#7442.type (with underlying type => C#7354.this.self#7442.type)\n     required: => N#7352.this.self#7442.type\n    class C extends M with N\n          ^\n\n    pos/t9111-inliner-workaround revealed need for:\n-  override def transformInfo(sym: Symbol, tp: Type): Type = synthFieldsAndAccessors(tp)\n+  override def transformInfo(sym: Symbol, tp: Type): Type = if (!sym.isJavaDefined) synthFieldsAndAccessors(tp) else tp\n\ncommit b56ca2fe56\nAuthor: Adriaan Moors <adriaan.moors@typesafe.com>\nDate:   6 weeks ago\n\n    static forwarders & private[this] val in trait\n\n    object Properties extends PropertiesTrait\n\n    trait PropertiesTrait {\n      // the protected member is not emitted as a static member of  -- it works when dropping the access modifier\n      // somehow, the module class member is considered deferred in BForwardersGen\n      protected val propFilename: String = /\n    }\n\n    // [log jvm] No forwarder for 'getter propFilename' from Properties to 'module class Properties': false || m.isDeferred == true || false || false\n\n    // the following method is missing compared to scalac\n    // public final class Properties {\n    //     public static String propFilename() {\n    //         return Properties$.MODULE$.propFilename();\n    //     }\n\n    trait Chars {\n      private[this] val char2uescapeArray = Array[Char]('\\', 'u', 0, 0, 0, 0)\n    }\n\n    object Chars extends Chars\n\n    // +++ w/reflect/scala/reflect/internal/Chars$.class\n    // -  private final [C scala83014char2uescapeArray\n\n    constant fold in forwarder for backwards compat\n    constant-typed final val in trait should yield impl method\n\n    bean{setter,getter} delegates to setter/getter (commit 1655d1b72c)","distinct":true,"url":"https://api.github.com/repos/adriaanm/scala/commits/cc14f055f0562568c4fbb6c1226128c86e19d97a"}]}