diff --git a/HOME_EXAM.md b/HOME_EXAM.md index abd3afc0be2397bdab23d16c456f1d8f367e6358..78a8f24cff2ef811924b41efd08cc5c3d6e28dc4 100644 --- a/HOME_EXAM.md +++ b/HOME_EXAM.md @@ -473,7 +473,7 @@ As previously mentioned, let assignment are unique declerations. Thus, the same ``` ```rust -x = 1; +x = (1 + 1) * 3; ``` ### Assignment bool ```math @@ -481,7 +481,7 @@ x = 1; ``` ```rust -x = true; +x = true != false; ``` For any assigment, the variable typed stored with the rhs evaluated type is checked. @@ -495,6 +495,7 @@ For any assigment, the variable typed stored with the rhs evaluated type is chec ```rust fn main() -> i32 { return 1 + 1; + return true; // Error } ``` The function is declared to return a type i32. @@ -508,6 +509,7 @@ The function is declared to return a type i32. ```rust fn main() -> bool { return true && true; + return 3; // Error } ``` The function is declared to return a type boolean. @@ -609,8 +611,7 @@ if: ; preds = %entry cont: ; preds = %cont3, %entry %iftmp = phi i32 - %b6 = load i32, i32* %b - ret i32 %b6 + ret i1 true while: ; preds = %while, %if %a4 = load i32, i32* %a @@ -620,8 +621,7 @@ while: ; preds = %while, %if cont3: ; preds = %while, %if %whiletmp = phi i32 - %a5 = load i32, i32* %a - ret i32 %a5 + ret i1 true br label %cont }