mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-25 13:40:12 +01:00
* added check for mismatch in generic class argument list * Update executable_semantics/testdata/generic_class/fail_generic_class_arg.carbon Co-authored-by: josh11b <josh11b@users.noreply.github.com> * add missing newline in trace output Co-authored-by: josh11b <josh11b@users.noreply.github.com>
27 lines
953 B
Plaintext
27 lines
953 B
Plaintext
// 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/generic_class/fail_generic_class_arg.carbon:24: type error in call: '(Type, Type)' is not implicitly convertible to '(Type)'
|
|
|
|
package ExecutableSemanticsTest api;
|
|
|
|
class Point(T:! Type) {
|
|
fn Create(x: T, y: T) -> Point(T) {
|
|
return {.x = x, .y = y};
|
|
}
|
|
|
|
var x: T;
|
|
var y: T;
|
|
}
|
|
|
|
fn Main() -> i32 {
|
|
var p: Point(i32) = Point(i32, i32).Create(0, 1);
|
|
return p.x;
|
|
}
|