mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-25 07:40:10 +01:00
Fix IsConcreteType for generic classes and add IsType predicate. (#1204)
* check that the return type is a type, add more implicit conversions * update IsConcreteType for generic classes, add IsType predicate * delete a comment * trivial change * move Witness wrt IsConcreteType and IsType * added comments to tests * update error line numbers
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
// 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} %{executable_semantics} %s 2>&1 | \
|
||||
// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s
|
||||
// RUN: %{not} %{executable_semantics} --parser_debug --trace_file=- %s 2>&1 | \
|
||||
// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s
|
||||
// AUTOUPDATE: %{executable_semantics} %s
|
||||
// CHECK: COMPILATION ERROR: {{.*}}/executable_semantics/testdata/function/fail_parameter_type.carbon:15: Expected a type, but got 42
|
||||
|
||||
package ExecutableSemanticsTest api;
|
||||
|
||||
// 42 cannot be used as the type of a parameter.
|
||||
fn f(x: 42) -> i32 {
|
||||
return x - 1;
|
||||
}
|
||||
|
||||
fn Main() -> i32 {
|
||||
return f(1);
|
||||
}
|
||||
Reference in New Issue
Block a user