lang: funcs: Catch non-specific type build error
If you had ambiguous code, and specified an invalid type, this could sneak through and become a runtime error, instead of a compile-time error. We fix this and add a test.
This commit is contained in:
@@ -8,7 +8,7 @@ $ayear = 60 * 60 * 24 * 365 # is a year in seconds (31536000)
|
||||
|
||||
$tmplvalues = struct{year => $secplusone, load => $theload,}
|
||||
|
||||
$theload = sys.load()->x1
|
||||
$theload float = sys.load()->x1 # ambiguous so we specify the type!
|
||||
|
||||
if 5 > 3 {
|
||||
file "/tmp/mgmt/datetime" {
|
||||
|
||||
@@ -9,7 +9,7 @@ $ayear = 60 * 60 * 24 * 365 # is a year in seconds (31536000)
|
||||
|
||||
$tmplvalues = struct{year => $secplusone, load => $theload, vumeter => $vumeter,}
|
||||
|
||||
$theload = sys.load()->x1
|
||||
$theload float = sys.load()->x1 # ambiguous so we specify the type!
|
||||
|
||||
$vumeter = example.vumeter("====", 10, 0.9)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user