Added TypeCheckTypeExp() and changed function type literal and similar type-checking logic to use the new function (#1256)

This commit is contained in:
pk19604014
2022-05-23 16:26:35 -07:00
committed by GitHub
parent cdc9428984
commit f0a34e4bf7
8 changed files with 117 additions and 49 deletions
+18
View File
@@ -0,0 +1,18 @@
// 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
//
// RUN: %{not} %{explorer} %s 2>&1 | \
// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s
// RUN: %{not} %{explorer} --parser_debug --trace_file=- %s 2>&1 | \
// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s
// AUTOUPDATE: %{explorer} %s
package ExplorerTest api;
// CHECK: COMPILATION ERROR: {{.*}}/explorer/testdata/generic_function/fail_not_type.carbon:[[@LINE+1]]: Expected a type, but got 42
fn F[a:! 42]();
fn Main() -> i32 {
return 0;
}