argotorg / solcore

experimental solidity compiler
13 stars 1 forks source link

Incorrect handling of type parameter inside a function #16

Closed Y-Nak closed 1 month ago

Y-Nak commented 2 months ago

The compiler allows the below example without causing any errors.

data Pair(a, b) = Pair(a, b)

function snd(p: Pair(a, Word)) -> a {
    match p {
    | Pair(_, w) => return w;
    };
}

function foo(p: a) -> Word {
    let x: Word = p;
    return x;
}
rodrigogribeiro commented 1 month ago

Fixed on main.

rodrigogribeiro commented 1 month ago

Fixed in last commit in main.