Constant Default Parameter Support #98
@ -354,7 +354,10 @@ impl TopLevelComposer {
|
|||||||
if let Ok(v) = v.try_into() {
|
if let Ok(v) = v.try_into() {
|
||||||
Ok(SymbolValue::I32(v))
|
Ok(SymbolValue::I32(v))
|
||||||
} else {
|
} else {
|
||||||
Ok(SymbolValue::I64(v.try_into().unwrap()))
|
Err(format!(
|
||||||
ychenfo marked this conversation as resolved
Outdated
|
|||||||
|
"int64 default parameter should be specified explicitly by `int64()` at {}",
|
||||||
ychenfo marked this conversation as resolved
Outdated
sb10q
commented
Isn't that an internal compiler error if this code is executed, not a problem with the user code? Isn't that an internal compiler error if this code is executed, not a problem with the user code?
Using ``unreachable!()`` sounds more appropriate here.
sb10q
commented
Isn't that an internal compiler error if this code is executed, not a problem with the user code? Isn't that an internal compiler error if this code is executed, not a problem with the user code?
Using ``unreachable!()`` sounds more appropriate here.
pca006132
commented
No I don't think so? It is possible for users to specify some default value outside the range of int64. I think a more appropriate error message would be value out of range and only say No I don't think so? It is possible for users to specify some default value outside the range of int64. I think a more appropriate error message would be value out of range and only say `int64` if the value is really an int64?
sb10q
commented
OK, yes. OK, yes.
ychenfo
commented
Thanks, this error message is updated in the new commit Thanks, this error message is updated in the new commit
|
|||||||
|
loc
|
||||||
|
))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Constant::Float(v) => Ok(SymbolValue::Double(*v)),
|
Constant::Float(v) => Ok(SymbolValue::Double(*v)),
|
||||||
|
Loading…
Reference in New Issue
Block a user
Should we just accept int32? int64 is handled in the call part, e.g.
int64(1234)
.this is handled in the new commit below