Commit 316f93f7 authored by Robert Griesemer's avatar Robert Griesemer

go/types: minimal support for alias declarations: don't crash

For #16339

Change-Id: I8927f40e0fd166795f41c784ad92449743f73af5
Reviewed-on: https://go-review.googlesource.com/30213Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
parent 59c63c71
......@@ -72,6 +72,7 @@ var tests = [][]string{
{"testdata/const1.src"},
{"testdata/constdecl.src"},
{"testdata/vardecl.src"},
{"testdata/aliasdecl.src"},
{"testdata/expr0.src"},
{"testdata/expr1.src"},
{"testdata/expr2.src"},
......
......@@ -274,6 +274,9 @@ func (check *Checker) collectObjects() {
check.declare(fileScope, nil, obj, token.NoPos)
}
case *ast.AliasSpec:
check.errorf(s.Name.Pos(), "cannot handle alias declarations yet")
case *ast.ValueSpec:
switch d.Tok {
case token.CONST:
......
// 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 aliasdecl
import "math"
const _ = math.Pi
const c /* ERROR "cannot handle alias declarations yet" */ => math.Pi
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment