Play

Check-in [af3cd0eeff]
Login
Overview
Comment:Make sure code use to reproduce bug works as expected.
Timelines: family | ancestors | descendants | both | bugfix-generics-and-quotations
Files: files | file ages | folders
SHA3-256: af3cd0eeff5604d540c6b0a250a14bc8ea9da82e36a3982a483b195734841813
User & Date: robin.hansen on 2020-11-19 05:56:25
Other Links: branch diff | manifest | tags
Context
2020-11-19
05:57
Fix 'Quotations' example in play ground. check-in: fc5483d159 user: robin.hansen tags: trunk, alpha-1, releases
05:56
Make sure code use to reproduce bug works as expected. Closed-Leaf check-in: af3cd0eeff user: robin.hansen tags: bugfix-generics-and-quotations
05:53
Make use of type annotations when type checking words. This allows for a workaround with stack range... check-in: 63296cf7f2 user: robin.hansen tags: bugfix-generics-and-quotations
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Modified wasm_tests/quotes.test.js from [bf404af7fa] to [1ebafeab8a].

13
14
15
16
17
18
19


























        : 1 -
    `);

    const result = await compiler.run(wat, 'main');

    expect(result.stackElement()).toBe(1);
});

































>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
        : 1 -
    `);

    const result = await compiler.run(wat, 'main');

    expect(result.stackElement()).toBe(1);
});

test('Basic quotation', async () => {
    const wat = await compiler.toWat(`
        deftype: Coordinate
        : x Int
        : y Int

        def: update-x
        type: Coordinate [ Int -- Int ] -- Coordinate
        : swap
          dup x>
          -rotate
          !
          >x

        def: main
        entry: true
        : 1 2 >Coordinate
          [ 1 + ] update-x
          x>
    `);

    const result = await compiler.run(wat, 'main');

    expect(result.stackElement()).toBe(2);
});