# Smart constructors bypassed by fromProduct method when combined with Mirrors

**URL:** <https://contributors.scala-lang.org/t/smart-constructors-bypassed-by-fromproduct-method-when-combined-with-mirrors/7586>\
**Category:** Language Design\
**Created:** [November 23, 2026, 11:08am UTC](https://contributors.scala-lang.org/t/smart-constructors-bypassed-by-fromproduct-method-when-combined-with-mirrors/7586 "2026-11-23T11:08:39Z")\
**Posts on this page:** 1\
**Showing post:** 22

<div class="post-metadata">

**Author:** ![przemek-pokrywka](https://contributors.scala-lang.org/user_avatar/contributors.scala-lang.org/przemek-pokrywka/32/2182_2.png) [@przemek-pokrywka](https://contributors.scala-lang.org/u/przemek-pokrywka)\
**Post date:** [November 24, 2026, 8:38pm UTC](https://contributors.scala-lang.org/t/smart-constructors-bypassed-by-fromproduct-method-when-combined-with-mirrors/7586/22 "2026-11-24T20:38:17Z")

</div>

> [@bishabosha](#):
>
> hard to detect automatically as this is just a convention, not something we can specifically look for

One indispensable and crucial part of the smart constructor convention is that the class constructor is private. So it should be sufficient to enforce private access, no? In other words, no external code should be allowed to call the private constructor, period. Not by means of reflection, not by means of modifying the bytecode-level accessors, not by anything. The class author added the “private” keyword for a reason. All code outside should respect it.

---

_[View the full topic](https://contributors.scala-lang.org/t/smart-constructors-bypassed-by-fromproduct-method-when-combined-with-mirrors/7586)._
