aboutsummaryrefslogtreecommitdiff
path: root/test/alias3.dir
diff options
context:
space:
mode:
authorRobert Griesemer <gri@golang.org>2016-11-04 15:48:39 -0700
committerRobert Griesemer <gri@golang.org>2016-11-04 23:44:15 +0000
commit8e970536dfe0b8ce74bfd0e83ae608c4a012d3c6 (patch)
tree213f5f7549f2f46dd14de38cdb54c01d0b193e19 /test/alias3.dir
parentdd1e7b3be0f64438e58f956bfb989608c7fa61bc (diff)
downloadgo-8e970536dfe0b8ce74bfd0e83ae608c4a012d3c6.tar.gz
go-8e970536dfe0b8ce74bfd0e83ae608c4a012d3c6.zip
cmd/compile: revert user-visible changes related to aliases
Reason: Decision to back out current alias implementation. Leaving import/export related code in place for now. For #16339. TBR=mdempsky Change-Id: Ib0897cab2c1c3dc8a541f2efb9893271b0b0efe2 Reviewed-on: https://go-review.googlesource.com/32757 Reviewed-by: Robert Griesemer <gri@golang.org>
Diffstat (limited to 'test/alias3.dir')
-rw-r--r--test/alias3.dir/a.go54
-rw-r--r--test/alias3.dir/b.go61
-rw-r--r--test/alias3.dir/c.go66
3 files changed, 0 insertions, 181 deletions
diff --git a/test/alias3.dir/a.go b/test/alias3.dir/a.go
deleted file mode 100644
index c14f834630..0000000000
--- a/test/alias3.dir/a.go
+++ /dev/null
@@ -1,54 +0,0 @@
-// Copyright 2016 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package a
-
-import (
- "bytes"
- "go/build"
- "io"
- "math"
-)
-
-func F(c *build.Context, w io.Writer) {}
-
-func Inlined() bool { var w Writer; return w == nil }
-
-func Check() {
- if Pi != math.Pi {
- panic(0)
- }
-
- var w Writer
- F(new(Context), w)
- F(new(build.Context), bytes.NewBuffer(nil))
-
- if &Default != &build.Default {
- panic(1)
- }
-
- if Sin(1) != math.Sin(1) {
- panic(2)
- }
-
- var _ *LimitedReader = new(LimitedReader2)
-}
-
-// export aliases
-const Pi => math.Pi
-
-type (
- Context => build.Context // not an interface
- Writer => io.Writer // interface
-)
-
-// different aliases may refer to the same original
-type LimitedReader => io.LimitedReader
-type LimitedReader2 => io.LimitedReader
-
-var Default => build.Default
-var Default2 => build.Default
-
-func Sin => math.Sin
-func Sin2 => math.Sin
diff --git a/test/alias3.dir/b.go b/test/alias3.dir/b.go
deleted file mode 100644
index d4550feca5..0000000000
--- a/test/alias3.dir/b.go
+++ /dev/null
@@ -1,61 +0,0 @@
-// Copyright 2016 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package b
-
-import (
- "./a"
- "bytes"
- "go/build"
- "io"
- "math"
-)
-
-func F => a.F
-func Inlined => a.Inlined
-
-var _ func(*Context, io.Writer) = a.F
-
-// check aliases
-func Check() {
- if Pi != math.Pi {
- panic(0)
- }
-
- var w Writer
- a.F(new(Context), w)
- F(new(build.Context), bytes.NewBuffer(nil))
-
- if !Inlined() {
- panic(1)
- }
-
- if &Default != &build.Default {
- panic(2)
- }
-
- if Sin(1) != math.Sin(1) {
- panic(3)
- }
-
- var _ *LimitedReader = new(LimitedReader2)
-}
-
-// re-export aliases
-const Pi => a.Pi
-
-type (
- Context => a.Context // not an interface
- Writer => a.Writer // interface
-)
-
-// different aliases may refer to the same original
-type LimitedReader => a.LimitedReader
-type LimitedReader2 => a.LimitedReader2
-
-var Default => a.Default
-var Default2 => a.Default2
-
-func Sin => a.Sin
-func Sin2 => a.Sin
diff --git a/test/alias3.dir/c.go b/test/alias3.dir/c.go
deleted file mode 100644
index 701483fac2..0000000000
--- a/test/alias3.dir/c.go
+++ /dev/null
@@ -1,66 +0,0 @@
-// Copyright 2016 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package main
-
-import (
- "./a"
- "./b"
- "bytes"
- "go/build"
- "math"
-)
-
-func f => b.F
-func inlined => b.Inlined
-
-var _ func(*context, a.Writer) = f
-
-func Check() {
- if pi != math.Pi {
- panic(0)
- }
-
- var w writer
- b.F(new(context), w)
- f(new(build.Context), bytes.NewBuffer(nil))
-
- if !inlined() {
- panic(1)
- }
-
- if &default_ != &build.Default {
- panic(2)
- }
-
- if sin(1) != math.Sin(1) {
- panic(3)
- }
-
- var _ *limitedReader = new(limitedReader2)
-}
-
-// local aliases
-const pi => b.Pi
-
-type (
- context => b.Context // not an interface
- writer => b.Writer // interface
-)
-
-// different aliases may refer to the same original
-type limitedReader => b.LimitedReader
-type limitedReader2 => b.LimitedReader2
-
-var default_ => b.Default
-var default2 => b.Default2
-
-func sin => b.Sin
-func sin2 => b.Sin
-
-func main() {
- a.Check()
- b.Check()
- Check()
-}