fail_in_class.carbon 447 B

12345678910111213141516171819
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. //
  5. // NOAUTOUPDATE
  6. package ExplorerTest api;
  7. class C {
  8. fn F() -> i32 {
  9. var n: i32;
  10. // CHECK:STDERR: COMPILATION ERROR: fail_in_class.carbon:[[@LINE+1]]: use of uninitialized variable n
  11. return n;
  12. }
  13. }
  14. fn Main() -> i32 {
  15. return C.F();
  16. }