From 39fc06a1fc86c9443392bdd69baa21462b18aaa7 Mon Sep 17 00:00:00 2001 From: Jamie Thompson Date: Fri, 14 Jul 2023 20:32:48 +0200 Subject: [PATCH] mark structural types as Scala 3 only --- _overviews/scala3-book/types-structural.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/_overviews/scala3-book/types-structural.md b/_overviews/scala3-book/types-structural.md index 246f9f127..8dee33f30 100644 --- a/_overviews/scala3-book/types-structural.md +++ b/_overviews/scala3-book/types-structural.md @@ -6,12 +6,18 @@ languages: [ru, zh-cn] num: 56 previous-page: types-opaque-types next-page: types-dependent-function +scala3: true +versionSpecific: true --- {% comment %} NOTE: It would be nice to simplify this more. {% endcomment %} +_Scala 2 has a weaker form of structural types based on Java reflection, achieved with `import scala.language.reflectiveCalls`_. + +## Introduction + Some use cases, such as modeling database access, are more awkward in statically typed languages than in dynamically typed languages. With dynamically typed languages, it’s natural to model a row as a record or object, and to select entries with simple dot notation, e.g. `row.columnName`.