Ignore:
Timestamp:
Apr 11, 2025, 1:23:39 AM (11 months ago)
Author:
Michael Brooks <mlbrooks@…>
Branches:
master, stuck-waitfor-destruct
Children:
dab6e39
Parents:
570e7ad
Message:

Give a few string operator overloads a preference boost.

Intent is to approximate: When selecting +/* candidates, treat it ambiguous until finding a user-given arithmetic-vs-string constraint, such as assigning the result to a string. Once a string interpretation is imposed, prefer an alternative that converts to string as soon as possible.

This description is not directly achievable with the CFA type system. The approximation has the known flaw shown in the string-operator test, where a fairly built-up expression that should be ambiguous is actually defaulting to the string version.

This change is the last of the string-overload reorganizations that the string-operator test was originally meant to illustrate. In Mike's opinion, the resulting state is ideal, except for the just-mentioned flaw.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tests/collections/.expect/string-operator.txt

    r570e7ad rd03a386  
    33
    44------------- Initialization
     5ab
     6ab
     7ab
     8ab
     9
     10abx
     11abx
     12abx
     13abx
     14
     15xab
     16xab
     17xab
     18xab
     19
     20axb
     21axb
     22axb
     23axb
     24
     25aaa
     26bbb
     27ababab
     28cdcdcd
     29
     30aaa
     31bbb
     32ababab
     33cdcdcd
     34
     35------------- Assignment
     36ab
     37ab
     38ab
     39ab
     40
     41ab
     42abab
     43ababab
     44abababab
     45
     46ab
     47abab
     48ababab
     49abababab
     50
     51ab
     52aabb
     53aaabbb
     54aaaabbbb
     55
     56aaa
     57bbb
     58ababab
     59cdcdcd
     60
     61aaa
     62bbb
     63ababab
     64cdcdcd
     65
     66------------- Bare (sout-direct)
    567(skip)
    668ab
     
    870ab
    971
    10 (skip)
     72abx
    1173abx
    1274abx
     
    2587(skip)
    2688bbb
    27 585
     89ababab
    2890cdcdcd
    2991
    3092(skip)
    3193bbb
    32 585
    33 cdcdcd
    34 
    35 ------------- Assignment
    36 (skip)
    37 ab
    38 ab
    39 ab
    40 
    41 (skip)
    42 ab
    43 abab
    4494ababab
    45 
    46 ab
    47 abab
    48 ababab
    49 abababab
    50 
    51 ab
    52 aabb
    53 aaabbb
    54 aaaabbbb
    55 
    56 (skip)
    57 bbb
    58 585
    59 cdcdcd
    60 
    61 (skip)
    62 bbb
    63 585
    64 cdcdcd
    65 
    66 ------------- Bare (sout-direct)
    67 (skip)
    68 ab
    69 ab
    70 ab
    71 
    72 (skip)
    73 abx
    74 abx
    75 abx
    76 
    77 xab
    78 xab
    79 xab
    80 xab
    81 
    82 axb
    83 axb
    84 axb
    85 axb
    86 
    87 (skip)
    88 bbb
    89 585
    90 cdcdcd
    91 
    92 (skip)
    93 bbb
    94 585
    9595cdcdcd
    9696
Note: See TracChangeset for help on using the changeset viewer.