-
Notifications
You must be signed in to change notification settings - Fork 21
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spurious illegal premature access to the unconstructed this
error when using local methods inside a by-name closure in super-class constructor parameter
#11969
Labels
fixed in Scala 3
This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/)
should compile
Milestone
Comments
neko-kai
added a commit
to 7mind/izumi
that referenced
this issue
Apr 30, 2020
neko-kai
added a commit
to 7mind/izumi
that referenced
this issue
Apr 30, 2020
Note: the above can also be worked around by making package example
class X(a: => Any)
class XImpl(
param: Int
) extends X({
def helper(): AutoCloseable = new AutoCloseable {
def close() = println(param)
}
helper()
}) Despite
But a Dotty release was affected by the above bug, but it's fixed on master - scala/scala3#8846 |
neko-kai
added a commit
to 7mind/izumi
that referenced
this issue
May 10, 2020
…Resource.SelfOf`,`.MutableOf`
pshirshov
pushed a commit
to 7mind/izumi
that referenced
this issue
May 13, 2020
…Resource.SelfOf`,`.MutableOf`
neko-kai
pushed a commit
to 7mind/izumi
that referenced
this issue
May 29, 2020
wip activation as a field in PlannerInput graph algos deprecated cleanup new planner: wip new planner: wip new planner: wip all green cleanups cleanups cleanups cleanups pre-resolution binding cleanup old gc excluded from main codepath cleanups cleanups cleanups node remappings exposed wip wip wip cleanups mutatorIndex in DIKey implement Provider#replaceKeys green tests cleanups some graph tests minor cleanups Make non-exhaustive pattern matches an error fix neme-plugin cross-build Build documentation in PRs remove zio-RC16 cleanups error on doc build failure cleanup KeyMinimizer cleanup formatting formatting formatting add failing activation tests, Rename PlannerInput.noGc->noGC, repurpose CglibBootstrap, document new Activation behavior, MutatorSyntax: Add ModuleDef DSL `modify` and `make.from[X].modify` methods Switch to `ProviderMagnet => ProviderMagnet` formulation wip wip green mutator test wip all green compilation fixed tailrec conflict tracer possible fix for zip fs race issue reorder method precedence in MutationResolver Implement bootstrap circular dependencies config using axis (need to remove tag merging for it to work though) wip remove tagwise merge Add `DIResource.OfInner` as a workaround for scala/bug#11969, add `DIResource.SelfOf`,`.MutableOf` wip fix after removing tag merge, wip new distage.Injector api vector cleanups more data for conflict resolver conflict resolver made aware of weak edges doc docs: wip fix fixes all green fixes fixes Add ModuleBase.tagged, .untagged, .removeTags, make Binding.withTag public rename `Docker.Mount` parameter names
neko-kai
pushed a commit
to 7mind/izumi
that referenced
this issue
Jul 7, 2020
wip activation as a field in PlannerInput graph algos deprecated cleanup new planner: wip new planner: wip new planner: wip all green cleanups cleanups cleanups cleanups pre-resolution binding cleanup old gc excluded from main codepath cleanups cleanups cleanups node remappings exposed wip wip wip cleanups mutatorIndex in DIKey implement Provider#replaceKeys green tests cleanups some graph tests minor cleanups Make non-exhaustive pattern matches an error fix neme-plugin cross-build Build documentation in PRs remove zio-RC16 cleanups error on doc build failure cleanup KeyMinimizer cleanup formatting formatting formatting add failing activation tests, Rename PlannerInput.noGc->noGC, repurpose CglibBootstrap, document new Activation behavior, MutatorSyntax: Add ModuleDef DSL `modify` and `make.from[X].modify` methods Switch to `ProviderMagnet => ProviderMagnet` formulation wip wip green mutator test wip all green compilation fixed tailrec conflict tracer possible fix for zip fs race issue reorder method precedence in MutationResolver Implement bootstrap circular dependencies config using axis (need to remove tag merging for it to work though) wip remove tagwise merge Add `DIResource.OfInner` as a workaround for scala/bug#11969, add `DIResource.SelfOf`,`.MutableOf` wip fix after removing tag merge, wip new distage.Injector api vector cleanups more data for conflict resolver conflict resolver made aware of weak edges doc docs: wip fix fixes all green fixes fixes Add ModuleBase.tagged, .untagged, .removeTags, make Binding.withTag public rename `Docker.Mount` parameter names
neko-kai
added a commit
to 7mind/izumi
that referenced
this issue
Jul 7, 2020
* 0.11.0 Mutators wip activation as a field in PlannerInput graph algos deprecated cleanup new planner: wip new planner: wip new planner: wip all green cleanups cleanups cleanups cleanups pre-resolution binding cleanup old gc excluded from main codepath cleanups cleanups cleanups node remappings exposed wip wip wip cleanups mutatorIndex in DIKey implement Provider#replaceKeys green tests cleanups some graph tests minor cleanups Make non-exhaustive pattern matches an error fix neme-plugin cross-build Build documentation in PRs remove zio-RC16 cleanups error on doc build failure cleanup KeyMinimizer cleanup formatting formatting formatting add failing activation tests, Rename PlannerInput.noGc->noGC, repurpose CglibBootstrap, document new Activation behavior, MutatorSyntax: Add ModuleDef DSL `modify` and `make.from[X].modify` methods Switch to `ProviderMagnet => ProviderMagnet` formulation wip wip green mutator test wip all green compilation fixed tailrec conflict tracer possible fix for zip fs race issue reorder method precedence in MutationResolver Implement bootstrap circular dependencies config using axis (need to remove tag merging for it to work though) wip remove tagwise merge Add `DIResource.OfInner` as a workaround for scala/bug#11969, add `DIResource.SelfOf`,`.MutableOf` wip fix after removing tag merge, wip new distage.Injector api vector cleanups more data for conflict resolver conflict resolver made aware of weak edges doc docs: wip fix fixes all green fixes fixes Add ModuleBase.tagged, .untagged, .removeTags, make Binding.withTag public rename `Docker.Mount` parameter names * fix build * forward-port fix for DistageTestRunner from feature/mutator-syntax-before-squash * Feature/add replace parameter ids on binding for mutator syntax (#1088) * wip * small clean up * fix * use modify syntax instead of SetParameterId * fixes * throw if new modified provider returns an incompatible type * Use magnet instead of partially applied class. (#1090) * Add ContractedId[I], use it everywhere. * Add ContactedId into missed functions. Remove unnecessary method. * Remove type parameter from ContractedId, rename to `Identifier` * Fix `namedByImpl` (but break its previous incorrect behaviour) * Uncomment `modify`, Remove duplication in dsl, lift restriction on `.aliased` being final modifier only due to operation sorting * WIP conflict resolution better error rendering * warning fixes Co-authored-by: Pavel Shirshov <[email protected]> Co-authored-by: Alex Liubymov <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
fixed in Scala 3
This issue does not exist in the Scala 3 compiler (https://github.com/lampepfl/dotty/)
should compile
reproduction steps
Minimized example:
problem
The above fails to compile with an error:
However, the error can be worked around by enclosing the block in a redundant function with
().pipe { _ => ... }
, in which case it will compile and work as expected at runtime:Which shows that the code doesn't actually trigger an implementation restriction.
expectation
Expected it to compile. This bug affects classes that pass an effect value or a block of code to the superconstructor such as this. dotty is not affected.
The text was updated successfully, but these errors were encountered: