mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 21:30:12 +01:00
I think the template files are simply an oversight. The fuzz files should probably be updated because failing on the `package` line isn't an interesting test of logic. Plus one minor comment edit.
This commit is contained in:
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 1
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
var x: i32;
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 1
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
choice Ints {
|
||||
None,
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
// CHECK:STDOUT: 210
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
class A { var n: i32; }
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 3
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
class Cell(T:! type) {
|
||||
fn Create(x: T) -> Cell(T) { return { .data = x }; }
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
//
|
||||
// AUTOUPDATE
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
fn Bad[T:! type](x: {.a: i32, .b: T}) {}
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
fn Main() -> i32 {
|
||||
var (x: auto, y: [i32;]) = (42, (0, 1));
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
interface X { fn F(); }
|
||||
impl i32 as X { fn F() {} }
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 1
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
fn Main() -> i32 {
|
||||
var x: i32;
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
// CHECK:STDOUT: ba.b: 1
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
alias AB = {.a: i32, .b: i32};
|
||||
alias BA = {.b: i32, .a: i32};
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
//
|
||||
// AUTOUPDATE
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
choice AB {
|
||||
A(),
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
fn ReturnIndirectly[T:! type](direct: bool, x: T) -> type {
|
||||
if (direct) {
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
// CHECK:STDOUT: 1
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package Foo api;
|
||||
package Foo;
|
||||
class X {
|
||||
fn F[self: Self]() -> i32 { return self.n; }
|
||||
var n: i32;
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
//
|
||||
// AUTOUPDATE
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
interface ManyTypes {
|
||||
let T0:! type;
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
fn ReturnSecond(_: i32, x: i32) -> i32 {
|
||||
return x;
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: -2
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
fn apply[T:! type, U:! type](f: __Fn (T) -> U, x: T) -> U {
|
||||
return f(x);
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
choice AB {
|
||||
A(),
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
// CHECK:STDOUT: (*dc).Foo(): 3
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
base class C {
|
||||
var value_c: i32;
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
// Test mutation of a global variable.
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
// CHECK:STDOUT: 3
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
interface GetX {
|
||||
fn DoIt[self: Self]() -> i32;
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 526
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
interface A { fn F() -> i32; fn G() -> i32; }
|
||||
interface B { fn H() -> i32; }
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
|
||||
fn Main() -> i32 {
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 3
|
||||
|
||||
package Foo api;
|
||||
package Foo;
|
||||
class X {
|
||||
fn F[self: Self](o: Self) -> Self { return {.n = self.n + o.n}; }
|
||||
var n: i32;
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
interface Vector {
|
||||
fn Add[self: Self](b: Self) -> Self;
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
// CHECK:STDOUT: ints greater eq: 1
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
fn Main() -> i32 {
|
||||
Print("strings less: {0}", if "hello" < "world" then 1 else 0);
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
namespace N;
|
||||
fn N.F() {}
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
// CHECK:STDOUT: 4: 4
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
class A {
|
||||
var n: i32;
|
||||
+1
-1
@@ -3,7 +3,7 @@
|
||||
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
||||
//
|
||||
// AUTOUPDATE
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
__mixin M1 {
|
||||
fn F1[self: Self](x: Self) -> Self{
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
class C(T:! type) {}
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
fn DoNothing() {
|
||||
// Empty block
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
fn Main() -> i32 {
|
||||
var s: String = '''filetype
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
fn CompareStr(s: String) -> i32 {
|
||||
if (s == ##"str"##) {
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
//
|
||||
// AUTOUPDATE
|
||||
|
||||
package ExplorerTest impl;
|
||||
impl package ExplorerTest;
|
||||
|
||||
fn Main() -> i32 {
|
||||
// CHECK:STDERR: RUNTIME ERROR: fail_index_empty.carbon:[[@LINE+1]]: Invalid `{}` in `Print: {}`
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
fn add1(x: i32) -> i32 {
|
||||
return x + 1;
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
//
|
||||
// AUTOUPDATE
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
interface IFace {
|
||||
// CHECK:STDERR: COMPILATION ERROR: fail_use_assoc_const_before_decl.carbon:[[@LINE+1]]: 'C' has not been declared yet
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
namespace N;
|
||||
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
// CHECK:STDOUT: (*c).Bar(): 1
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
base class C {
|
||||
var a: i32;
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
//
|
||||
// AUTOUPDATE
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
fn Main() -> i32 {
|
||||
var x: i32;
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
interface Number {
|
||||
fn Zero() -> Self;
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 1
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
interface ManyTypes {
|
||||
let T0:! type;
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
class Point {
|
||||
fn Origin() -> Point {
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
//
|
||||
// AUTOUPDATE
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
interface Container {
|
||||
let Element:! type;
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 1
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
fn Main() -> i32 {
|
||||
var (x: i32, y: i32);
|
||||
+1
-1
@@ -9,7 +9,7 @@
|
||||
// CHECK:STDOUT: c.c: 3
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
base class A {
|
||||
fn FunctionA() {}
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
// CHECK:STDOUT: Print: {0}
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
fn Main() -> i32 {
|
||||
Print("Print: {{0}");
|
||||
+1
-1
@@ -16,7 +16,7 @@
|
||||
// CHECK:STDOUT: DESTRUCTOR C
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
base class A {
|
||||
virtual destructor[self: Self] {
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
//
|
||||
// AUTOUPDATE
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
fn Main() -> i32 {
|
||||
// CHECK:STDERR: COMPILATION ERROR: fail_too_many_args.carbon:[[@LINE+1]]: Print takes 1 or 2 arguments, received 5
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
//
|
||||
// AUTOUPDATE
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
fn Main() -> i32 {
|
||||
// CHECK:STDERR: COMPILATION ERROR: fail_assign_to_rval.carbon:[[@LINE+1]]: Only a reference expression can be assigned to, but got `1`
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 25
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
class List {
|
||||
choice Node {
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 3
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
fn AddInt(a: i32, b: i32) -> i32 {
|
||||
if (a == b) {
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
// CHECK:STDOUT: String
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package Testcase api;
|
||||
package Testcase;
|
||||
|
||||
interface HasName {
|
||||
let Name:! String;
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
fn add(x: i32, y: i32) -> auto { return x + y; }
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDERR: RUNTIME ERROR: {{.*}}/explorer/data/prelude.carbon:{{.*}}: Integer overflow
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
fn Main() -> i32 {
|
||||
var a: auto = 5 << -1;
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 1
|
||||
|
||||
package Foo api;
|
||||
package Foo;
|
||||
interface A { fn F() -> i32; }
|
||||
class X {
|
||||
extend impl as A {
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
//
|
||||
// AUTOUPDATE
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
fn Main() -> i32 {
|
||||
{
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
choice AB {
|
||||
A(),
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
class Point {
|
||||
var x: i32;
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
// CHECK:STDOUT: 0
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
class A { var n: i32; }
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
import ExplorerTest library "Nonexistent";
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
//
|
||||
// AUTOUPDATE
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
class A {}
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 1
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
fn Main() -> i32 {
|
||||
var x: i32;
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
// CHECK:STDOUT: 3
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
base class A {
|
||||
var a: i32;
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
choice Ints {
|
||||
None,
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
//
|
||||
// AUTOUPDATE
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
class ConvertTo(T:! type) {
|
||||
var v: T;
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
//
|
||||
// AUTOUPDATE
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
fn Main() -> i32 {
|
||||
// CHECK:STDERR: COMPILATION ERROR: fail_destination_not_type.carbon:[[@LINE+1]]: type error in type expression: 'i32' is not implicitly convertible to 'type'
|
||||
+1
-1
@@ -8,7 +8,7 @@
|
||||
// CHECK:STDOUT: This is a String Entry 4
|
||||
// CHECK:STDOUT: Value 1337
|
||||
// CHECK:STDOUT: result: 0
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
class Node(T:! type) {
|
||||
fn Create(value: T)-> Node(T) {
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 12
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
fn Main() -> i32 {
|
||||
var cond: if true then bool else i32 = true;
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 5
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
class A { var n: i32; }
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 2
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
fn A(b: bool) -> i32 {
|
||||
match (b) {
|
||||
+1
-1
@@ -6,7 +6,7 @@
|
||||
// CHECK:STDOUT: Nice!
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
fn Main() -> i32 {
|
||||
var i: i32 = Rand(0, 100);
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
//
|
||||
// AUTOUPDATE
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
fn Main() -> i32 {
|
||||
// CHECK:STDERR: RUNTIME ERROR: fail_div_by_zero.carbon:[[@LINE+1]]: division by zero
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 2
|
||||
|
||||
package Foo api;
|
||||
package Foo;
|
||||
fn Main() -> i32 {
|
||||
return {.m = 1, .n = 2}.({.n: i32, .m: i32}.n);
|
||||
}
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
// CHECK:STDOUT: BothFs.F
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
choice ImplKind {
|
||||
Checked,
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
fn Id(t: type) -> auto { return t; }
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
//
|
||||
// AUTOUPDATE
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
class Shape {
|
||||
var x: i32;
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 12
|
||||
|
||||
package Foo api;
|
||||
package Foo;
|
||||
interface A {
|
||||
fn F[self: Self]() -> i32;
|
||||
}
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
//
|
||||
// AUTOUPDATE
|
||||
|
||||
package ExplorerTest impl;
|
||||
impl package ExplorerTest;
|
||||
|
||||
fn Main() -> i32 {
|
||||
// CHECK:STDERR: RUNTIME ERROR: fail_single_brace.carbon:[[@LINE+1]]: `{` must be followed by a second `{` or index in `{`
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
//
|
||||
// AUTOUPDATE
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
fn Main() -> i32 {
|
||||
// CHECK:STDERR: SYNTAX ERROR: fail_raw_block_quotes_not_on_own_line.carbon:[[@LINE+1]]: Invalid block string: Should end with triple quotes: error: closing '''
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
// Check that even generic parameters are looked up in the namespace of an
|
||||
// entity.
|
||||
+1
-1
@@ -11,7 +11,7 @@
|
||||
// CHECK:STDOUT: cc.Bar() -> 2
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
base class C {
|
||||
virtual fn Foo[self: Self]() -> i32 {
|
||||
+1
-1
@@ -12,7 +12,7 @@
|
||||
// CHECK:STDOUT: Return
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
|
||||
base class A{
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
interface Vector {
|
||||
fn Zero() -> Self;
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
fn Main() -> i32 {
|
||||
if (0 == 1) {
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
//
|
||||
// AUTOUPDATE
|
||||
|
||||
package ExplorerTest impl;
|
||||
impl package ExplorerTest;
|
||||
|
||||
fn Main() -> i32 {
|
||||
// CHECK:STDERR: RUNTIME ERROR: fail_index_bounds1.carbon:[[@LINE+1]]: Index invalid with argument count of 1 at offset 12 in `Print: {0} {1}`
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
//
|
||||
// AUTOUPDATE
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
__mixin Operations {
|
||||
fn F[self: Self](x: Self) -> Self{
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 12
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
interface Runnable {
|
||||
fn Run[self: Self]() -> i32;
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 1
|
||||
|
||||
package Foo api;
|
||||
package Foo;
|
||||
interface A { fn F[self: Self]() -> i32; }
|
||||
class X {
|
||||
extend impl as A {
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
// Ensure that we can declare all different kinds of declarations as namespace
|
||||
// members.
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
//
|
||||
// AUTOUPDATE
|
||||
|
||||
package EmptyIdentifier impl;
|
||||
impl package EmptyIdentifier;
|
||||
|
||||
fn A() {
|
||||
// CHECK:STDERR: RUNTIME ERROR: fail_function_recursion.carbon:[[@LINE+1]]: stack overflow: too many interpreter actions on stack
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
fn Main() -> i32 {
|
||||
if (0 == 1) {
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
//
|
||||
// AUTOUPDATE
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
fn AddInt(a: i32, b: i32) -> i32 {
|
||||
// CHECK:STDERR: COMPILATION ERROR: fail_returned_var_type_mismatch.carbon:[[@LINE+1]]: type of returned var `bool` does not match return type `i32`
|
||||
+1
-1
@@ -13,7 +13,7 @@
|
||||
// CHECK:STDOUT: None: 4
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
interface A {
|
||||
fn Which() -> i32;
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
//
|
||||
// AUTOUPDATE
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
class C {
|
||||
// CHECK:STDERR: COMPILATION ERROR: fail_member_of_self.carbon:[[@LINE+1]]: incomplete type `class C` used in type of variable
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
interface Invalid {}
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
//
|
||||
// AUTOUPDATE
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
fn f(x: i32, y: i32) -> i32 { return x + y; }
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
//
|
||||
// AUTOUPDATE
|
||||
|
||||
package EmptyIdentifier impl;
|
||||
impl package EmptyIdentifier;
|
||||
|
||||
fn Main() -> i32 {
|
||||
while (true) {
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
//
|
||||
// AUTOUPDATE
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
fn Main() -> i32 {
|
||||
// CHECK:STDERR: SYNTAX ERROR: fail_raw_block_more_hash_tags_on_left.carbon:[[@LINE+1]]: Unexpected end of file
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 4
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
alias TypeAlias = i32;
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
__mixin Operations {
|
||||
fn Square[self: Self](x:i32) -> i32{
|
||||
+1
-1
@@ -4,7 +4,7 @@
|
||||
//
|
||||
// AUTOUPDATE
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
class C {
|
||||
// CHECK:STDERR: SYNTAX ERROR: fail_method_self_misspelled.carbon:[[@LINE+1]]: illegal binding pattern in implicit parameter list
|
||||
+1
-1
@@ -5,7 +5,7 @@
|
||||
// AUTOUPDATE
|
||||
// CHECK:STDOUT: result: 0
|
||||
|
||||
package ExplorerTest api;
|
||||
package ExplorerTest;
|
||||
|
||||
class Point {
|
||||
fn Origin() -> Point {
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user