mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 21:31:24 +01:00
adding missing exit for pattern variable in wrong context and a test case for it (#324)
This commit is contained in:
@@ -0,0 +1,8 @@
|
||||
// Part of the Carbon Language project, under the Apache License v2.0 with LLVM
|
||||
// Exceptions. See /LICENSE for license information.
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
|
||||
fn main() -> Int {
|
||||
Int : x; // error
|
||||
return 1;
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
********** source program **********
|
||||
fn main () -> Int {
|
||||
Int: x;
|
||||
return 1;
|
||||
|
||||
}
|
||||
********** type checking **********
|
||||
--- step exp Int --->
|
||||
--- step exp Int --->
|
||||
2: compilation error, pattern variables are only allowed in pattern context
|
||||
EXIT CODE: 255
|
||||
Reference in New Issue
Block a user