| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- // 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
- // TIP: To test this file alone, run:
- // TIP: bazel test //toolchain/testing:file_test --test_arg=--file_tests=toolchain/check/testdata/interface/no_prelude/fail_redeclare_member.carbon
- // TIP: To dump output, run:
- // TIP: bazel run //toolchain/testing:file_test -- --dump_output --file_tests=toolchain/check/testdata/interface/no_prelude/fail_redeclare_member.carbon
- interface Interface {
- fn F();
- // CHECK:STDERR: fail_redeclare_member.carbon:[[@LINE+6]]:3: error: duplicate name being declared in the same scope
- // CHECK:STDERR: fn F();
- // CHECK:STDERR: ^~~~~~~
- // CHECK:STDERR: fail_redeclare_member.carbon:[[@LINE-4]]:3: note: name is previously declared here
- // CHECK:STDERR: fn F();
- // CHECK:STDERR: ^~~~~~~
- fn F();
- }
- // CHECK:STDOUT: --- fail_redeclare_member.carbon
- // CHECK:STDOUT:
- // CHECK:STDOUT: constants {
- // CHECK:STDOUT: %.1: type = interface_type @Interface [template]
- // CHECK:STDOUT: %Self: %.1 = bind_symbolic_name Self 0 [symbolic]
- // CHECK:STDOUT: %F.type: type = fn_type @F [template]
- // CHECK:STDOUT: %.2: type = tuple_type () [template]
- // CHECK:STDOUT: %F: %F.type = struct_value () [template]
- // CHECK:STDOUT: %.3: type = assoc_entity_type %.1, %F.type [template]
- // CHECK:STDOUT: %.4: %.3 = assoc_entity element0, @Interface.%F.decl [template]
- // CHECK:STDOUT: %.type: type = fn_type @.1 [template]
- // CHECK:STDOUT: %.5: %.type = struct_value () [template]
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: file {
- // CHECK:STDOUT: package: <namespace> = namespace [template] {
- // CHECK:STDOUT: .Interface = %Interface.decl
- // CHECK:STDOUT: }
- // CHECK:STDOUT: %Interface.decl: type = interface_decl @Interface [template = constants.%.1] {} {}
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: interface @Interface {
- // CHECK:STDOUT: %Self: %.1 = bind_symbolic_name Self 0 [symbolic = constants.%Self]
- // CHECK:STDOUT: %F.decl: %F.type = fn_decl @F [template = constants.%F] {} {}
- // CHECK:STDOUT: %.loc12: %.3 = assoc_entity element0, %F.decl [template = constants.%.4]
- // CHECK:STDOUT: %.decl: %.type = fn_decl @.1 [template = constants.%.5] {} {}
- // CHECK:STDOUT:
- // CHECK:STDOUT: !members:
- // CHECK:STDOUT: .Self = %Self
- // CHECK:STDOUT: .F = %.loc12
- // CHECK:STDOUT: witness = (%F.decl)
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: generic fn @F(@Interface.%Self: %.1) {
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn();
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: generic fn @.1(@Interface.%Self: %.1) {
- // CHECK:STDOUT:
- // CHECK:STDOUT: fn();
- // CHECK:STDOUT: }
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @F(constants.%Self) {}
- // CHECK:STDOUT:
- // CHECK:STDOUT: specific @.1(constants.%Self) {}
- // CHECK:STDOUT:
|