Tests for invalid types.

This commit is contained in:
chriseth 2020-02-19 16:30:35 +01:00
parent 6eec968365
commit 9140bc52c4
4 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,7 @@
{
let x: invalidType
}
// ====
// dialect: evmTyped
// ----
// TypeError: (10-24): "invalidType" is not a valid type (user defined types are not yet supported).

View File

@ -0,0 +1,8 @@
{
let x := 1:invalidType
}
// ====
// dialect: evmTyped
// ----
// TypeError: (15-28): "invalidType" is not a valid type (user defined types are not yet supported).
// TypeError: (10-11): Assigning value of type "invalidType" to variable of type "u256.

View File

@ -0,0 +1,8 @@
{
function f(a: invalidType) -> b: invalidType {}
}
// ====
// dialect: evmTyped
// ----
// TypeError: (17-31): "invalidType" is not a valid type (user defined types are not yet supported).
// TypeError: (36-50): "invalidType" is not a valid type (user defined types are not yet supported).

View File

@ -0,0 +1,9 @@
{
switch 1
case 8: invalidType {}
}
// ====
// dialect: evmTyped
// ----
// TypeError: (24-38): Expected a value of type "u256" but got "invalidType"
// TypeError: (24-38): "invalidType" is not a valid type (user defined types are not yet supported).