mirror of
https://github.com/carbon-language/carbon-lang.git
synced 2026-09-24 21:40:12 +01:00
Handles tuples (including nested tuples) in the semantic phase of the tool chain. Does not handle tuple element access yet. --------- Co-authored-by: Farzana Ahmed Siddique <fasiddique@google.com> Co-authored-by: Jon Ross-Perkins <jperkins@google.com>
54 lines
1.9 KiB
Plaintext
54 lines
1.9 KiB
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
|
|
//
|
|
// AUTOUPDATE
|
|
// CHECK:STDOUT: cross_reference_irs_size: 1
|
|
// CHECK:STDOUT: functions: [
|
|
// CHECK:STDOUT: ]
|
|
// CHECK:STDOUT: integer_literals: [
|
|
// CHECK:STDOUT: ]
|
|
// CHECK:STDOUT: real_literals: [
|
|
// CHECK:STDOUT: ]
|
|
// CHECK:STDOUT: strings: [
|
|
// CHECK:STDOUT: x,
|
|
// CHECK:STDOUT: ]
|
|
// CHECK:STDOUT: types: [
|
|
// CHECK:STDOUT: node+1,
|
|
// CHECK:STDOUT: nodeIntegerType,
|
|
// CHECK:STDOUT: node+3,
|
|
// CHECK:STDOUT: node+6,
|
|
// CHECK:STDOUT: ]
|
|
// CHECK:STDOUT: nodes: [
|
|
// CHECK:STDOUT: {kind: StubReference, arg0: nodeIntegerType, type: typeTypeType},
|
|
// CHECK:STDOUT: {kind: TupleType, arg0: typeBlock0, type: typeTypeType},
|
|
// CHECK:STDOUT: {kind: TupleValue, arg0: block2, type: type0},
|
|
// CHECK:STDOUT: {kind: TupleType, arg0: typeBlock1, type: typeTypeType},
|
|
// CHECK:STDOUT: {kind: VarStorage, type: type2},
|
|
// CHECK:STDOUT: {kind: BindName, arg0: str0, arg1: node+4, type: type2},
|
|
// CHECK:STDOUT: {kind: TupleType, arg0: typeBlock2, type: typeTypeType},
|
|
// CHECK:STDOUT: {kind: TupleValue, arg0: block0, type: type3},
|
|
// CHECK:STDOUT: {kind: Assign, arg0: node+4, arg1: nodeError, type: typeError},
|
|
// CHECK:STDOUT: ]
|
|
// CHECK:STDOUT: node_blocks: [
|
|
// CHECK:STDOUT: [
|
|
// CHECK:STDOUT: ],
|
|
// CHECK:STDOUT: [
|
|
// CHECK:STDOUT: node+0,
|
|
// CHECK:STDOUT: node+1,
|
|
// CHECK:STDOUT: node+2,
|
|
// CHECK:STDOUT: node+3,
|
|
// CHECK:STDOUT: node+4,
|
|
// CHECK:STDOUT: node+5,
|
|
// CHECK:STDOUT: node+6,
|
|
// CHECK:STDOUT: node+7,
|
|
// CHECK:STDOUT: node+8,
|
|
// CHECK:STDOUT: ],
|
|
// CHECK:STDOUT: [
|
|
// CHECK:STDOUT: node+0,
|
|
// CHECK:STDOUT: ],
|
|
// CHECK:STDOUT: ]
|
|
|
|
// CHECK:STDERR: fail_assign_empty.carbon:[[@LINE+1]]:19: Cannot implicitly convert from `() as type` to `(i32,) as type`.
|
|
var x: (i32,) = ();
|