mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-10-05 22:02:55 +01:00
This causes compile-time evaluation to give the same result as runtime evaluation wherever possible. In particular, referencing a generic parameter at compile time will resolve to the actual value if we're evaluating a call to the enclosing function so a value for the parameter is available in the call frame. Clean up recently-added support for `SymbolicWitness`es using this.
25 lines
652 B
Plaintext
25 lines
652 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: %{explorer} %s 2>&1 | \
|
|
// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes=false %s
|
|
// RUN: %{explorer} --parser_debug --trace_file=- %s 2>&1 | \
|
|
// RUN: %{FileCheck} --match-full-lines --allow-unused-prefixes %s
|
|
// AUTOUPDATE: %{explorer} %s
|
|
// CHECK: result: 0
|
|
|
|
package ExplorerTest api;
|
|
|
|
class C(T:! Type) {}
|
|
|
|
fn F(T:! Type) -> Type {
|
|
return C(T);
|
|
}
|
|
|
|
fn Main() -> i32 {
|
|
var v: F(i32) = {};
|
|
var w: C(i32) = v;
|
|
return 0;
|
|
}
|