Files
carbon-lang/explorer/fuzzing/fuzzer_corpus/b6faa454160b04a71aebd4eefba1074e82f6b991
T
josh11bandGeoff Romer 46503c0a9d Explorer and toolchain changes to implement #2483 (#2707)
This PR is making two main changes to the Explorer and Toolchain:
- Replace the `is` keyword in `where SomeType is SomeInterface` with `impls`, so it is `where SomeType impls SomeInterface`
- Rewrite uses of the "impls" to something else to avoid, frequently "`impl` declarations" or "implementations", to avoid confusion with the `impls` keyword.

---------

Co-authored-by: Geoff Romer <gromer@google.com>
2023-03-28 12:28:52 -07:00

374 lines
7.4 KiB
Plaintext

compilation_unit {
package_statement {
package_name: "ExplorerTest"
}
is_api: true
declarations {
interface {
name {
name: "A"
}
members {
function {
name {
name: "F"
}
param_pattern {
}
return_term {
kind: Expression
type {
int_type_literal {
}
}
}
}
}
}
}
declarations {
interface {
name {
name: "B"
}
members {
function {
name {
name: "F"
}
param_pattern {
}
return_term {
kind: Expression
type {
int_type_literal {
}
}
}
}
}
}
}
declarations {
impl {
kind: InternalImpl
impl_type {
int_type_literal {
}
}
interface {
identifier {
name: "A"
}
}
members {
function {
name {
name: "F"
}
param_pattern {
}
return_term {
kind: Expression
type {
int_type_literal {
}
}
}
body {
statements {
return_expression_statement {
expression {
int_literal {
value: 1
}
}
}
}
}
}
}
}
}
declarations {
impl {
kind: InternalImpl
impl_type {
int_type_literal {
}
}
interface {
identifier {
name: "B"
}
}
members {
function {
name {
name: "F"
}
param_pattern {
}
return_term {
kind: Expression
type {
int_type_literal {
}
}
}
body {
statements {
return_expression_statement {
expression {
int_literal {
value: 2
}
}
}
}
}
}
}
}
}
declarations {
function {
name {
name: "GetA"
}
deduced_parameters {
name: "T"
type {
identifier {
name: "A"
}
}
}
param_pattern {
fields {
binding_pattern {
name: "x"
type {
expression_pattern {
expression {
identifier {
name: "T"
}
}
}
}
}
}
}
return_term {
kind: Expression
type {
int_type_literal {
}
}
}
body {
statements {
return_expression_statement {
expression {
call {
function {
simple_member_access {
field: "F"
object {
identifier {
name: "x"
}
}
}
}
argument {
tuple_literal {
}
}
}
}
}
}
}
}
}
declarations {
function {
name {
name: "GetAB"
}
deduced_parameters {
name: "T"
type {
where {
base {
identifier {
name: "B"
}
}
clauses {
impls {
type {
designator {
name: "Self"
}
}
constraint {
identifier {
name: "A"
}
}
}
}
}
}
}
param_pattern {
fields {
binding_pattern {
name: "x"
type {
expression_pattern {
expression {
identifier {
name: "T"
}
}
}
}
}
}
}
return_term {
kind: Expression
type {
int_type_literal {
}
}
}
body {
statements {
return_expression_statement {
expression {
operator {
op: Add
arguments {
operator {
op: Mul
arguments {
int_literal {
value: 10
}
}
arguments {
call {
function {
identifier {
name: "GetA"
}
}
argument {
tuple_literal {
fields {
identifier {
name: "x"
}
}
}
}
}
}
}
}
arguments {
call {
function {
simple_member_access {
field: "F"
object {
identifier {
name: "x"
}
}
}
}
argument {
tuple_literal {
}
}
}
}
}
}
}
}
}
}
}
declarations {
function {
name {
name: "Main"
}
param_pattern {
}
return_term {
kind: Expression
type {
int_type_literal {
}
}
}
body {
statements {
variable_definition {
pattern {
binding_pattern {
name: "v"
type {
expression_pattern {
expression {
int_type_literal {
}
}
}
}
}
}
init {
int_literal {
value: 0
}
}
is_returned: false
}
}
statements {
return_expression_statement {
expression {
call {
function {
identifier {
name: "GetAB"
}
}
argument {
tuple_literal {
fields {
identifier {
name: "v"
}
}
}
}
}
}
}
}
}
}
}
}