You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/docs/reference/other-new-features/creator-applications.md
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -13,13 +13,13 @@ class StringBuilder(s: String) {
13
13
StringBuilder("abc") // same as new StringBuilder("abc")
14
14
StringBuilder() // same as new StringBuilder()
15
15
```
16
-
Creator applications generalize a functionality provided so far only for case classes, but the mechanism how this is achieved is different. Instead generating an apply method, the compiler adds a new possible interpretation to a function call `f(args)`. The previous rules are:
16
+
Creator applications generalize a functionality provided so far only for case classes, but the mechanism how this is achieved is different. Instead of generating an apply method, the compiler adds a new possible interpretation to a function call `f(args)`. The previous rules are:
17
17
18
18
Given a function call `f(args)`,
19
19
20
20
- if `f` is a method applicable to `args`, typecheck `f(args)` unchanged,
21
21
- otherwise, if `f` has an `apply` method applicable to `args` as a member, continue with `f.apply(args)`,
22
-
- otherwise, if `f` is of the form `p.m` and there is an implicit conversion `c` applicable to `p` so that `c(p).m` is applicable to `args`, continue with `c(p).m(args)`
22
+
- otherwise, if `f` is of the form `p.m` and there is an implicit conversion `c` applicable to `p` so that `c(p).m` is applicable to `args`, continue with `c(p).m(args)`
23
23
24
24
There's now a fourth rule following these rules:
25
25
@@ -40,4 +40,4 @@ caused numerous problems, including
40
40
41
41
- overloading ambiguities
42
42
- overriding errors
43
-
- shadowing of user-defined `apply` methods by more specific auto-generated ones.
43
+
- shadowing of user-defined `apply` methods by more specific auto-generated ones.
0 commit comments