Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FunC compilation fails when a lot of getters #75

Closed
aSpite opened this issue Oct 20, 2023 · 3 comments
Closed

FunC compilation fails when a lot of getters #75

aSpite opened this issue Oct 20, 2023 · 3 comments
Labels
kind: bug Something isn't working or isn't right
Milestone

Comments

@aSpite
Copy link
Contributor

aSpite commented Oct 20, 2023

In order to reproduce this problem, it is necessary to add some more getters in src/test/features/maps.tact:

get fun IntMap10_1Value(key: Int, value: Int): Int? {
    let intMap10_1: map<Int as int8, Int> = emptyMap();
    intMap10_1.set(key, value);
    return intMap10_1.get(key);
}

get fun IntMap10_2Value(key: Int, value: Int): Int? {
    let intMap10_2: map<Int as int16, Int> = emptyMap();
    intMap10_2.set(key, value);
    return intMap10_2.get(key);
}

get fun IntMap10_3Value(key: Int, value: Int): Int? {
    let intMap10_3: map<Int as int32, Int> = emptyMap();
    intMap10_3.set(key, value);
    return intMap10_3.get(key);
}

get fun IntMap10_4Value(key: Int, value: Int): Int? {
    let intMap10_4: map<Int as int64, Int> = emptyMap();
    intMap10_4.set(key, value);
    return intMap10_4.get(key);
}

get fun IntMap10_5Value(key: Int, value: Int): Int? {
    let intMap10_5: map<Int as int128, Int> = emptyMap();
    intMap10_5.set(key, value);
    return intMap10_5.get(key);
}

get fun IntMap10_6Value(key: Int, value: Int): Int? {
    let intMap10_6: map<Int as int256, Int> = emptyMap();
    intMap10_6.set(key, value);
    return intMap10_6.get(key);
}

get fun IntMap10_7Value(key: Int, value: Int): Int? {
    let intMap10_7: map<Int as int257, Int> = emptyMap();
    intMap10_7.set(key, value);
    return intMap10_7.get(key);
}

get fun IntMap11_1Value(key: Int, value: Int): Int? {
    let intMap11_1: map<Int as uint8, Int> = emptyMap();
    intMap11_1.set(key, value);
    return intMap11_1.get(key);
}

get fun IntMap11_2Value(key: Int, value: Int): Int? {
    let intMap11_2: map<Int as uint16, Int> = emptyMap();
    intMap11_2.set(key, value);
    return intMap11_2.get(key);
}

get fun IntMap11_3Value(key: Int, value: Int): Int? {
    let intMap11_3: map<Int as uint32, Int> = emptyMap();
    intMap11_3.set(key, value);
    return intMap11_3.get(key);
}

get fun IntMap11_4Value(key: Int, value: Int): Int? {
    let intMap11_4: map<Int as uint64, Int> = emptyMap();
    intMap11_4.set(key, value);
    return intMap11_4.get(key);
}

get fun IntMap11_5Value(key: Int, value: Int): Int? {
    let intMap11_5: map<Int as uint128, Int> = emptyMap();
    intMap11_5.set(key, value);
    return intMap11_5.get(key);
}

get fun IntMap11_6Value(key: Int, value: Int): Int? {
    let intMap11_6: map<Int as uint256, Int> = emptyMap();
    intMap11_6.set(key, value);
    return intMap11_6.get(key);
}

After that you will start getting an error when trying to compile (yarn run gen:compiler):

💼 Compiling project maps...
   > MapTestContract: tact compiler
   > MapTestContract: func compiler
[ 1][t 0][2023-10-20 12:11:49.446000][Fift.cpp:67]      top: <continuation 0x2820010>
level 1: <continuation 0x250cb00>
level 2: <text interpreter continuation>

main.fif:6031:  $MapTestContract$_internal_text_4aedba9b6dfe7cb8e0:-?
💥 Compilation failed. Skipping packaging
@logvik
Copy link
Member

logvik commented Oct 20, 2023

get fun IntMap10_7Value(key: Int, value: Int): Int? {
    let intMap10_7: map<Int as int257, Int> = emptyMap(); // maybe here int257 is not valid?
    intMap10_7.set(key, value);
    return intMap10_7.get(key);
}

@aSpite
Copy link
Contributor Author

aSpite commented Oct 20, 2023

@logvik ,

No, that's right. The problem starts exactly after adding new getters. At the same time, I left all these getters and deleted some old ones, and everything was compiled successfully.

@anton-trunov anton-trunov added this to the v1.4.0 milestone Feb 16, 2024
@anton-trunov anton-trunov added the kind: bug Something isn't working or isn't right label Apr 24, 2024
@anton-trunov
Copy link
Member

This should be fixed with #297. Feel free to reopen if it's somehow not fixed :)

@anton-trunov anton-trunov modified the milestones: v1.4.0, v1.3.0 Apr 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: bug Something isn't working or isn't right
Projects
None yet
Development

No branches or pull requests

3 participants