func (n *ParenExpr) Implicit() bool { return n.flags&miniExprImplicit != 0 }
func (n *ParenExpr) SetImplicit(b bool) { n.flags.set(miniExprImplicit, b) }
-func (*ParenExpr) CanBeNtype() {}
-
-// SetOTYPE changes n to be an OTYPE node returning t,
-// like all the type nodes in type.go.
-func (n *ParenExpr) SetOTYPE(t *types.Type) {
- n.op = OTYPE
- n.typ = t
- t.SetNod(n)
-}
-
// A RawOrigExpr represents an arbitrary Go expression as a string value.
// When printed in diagnostics, the string value is written out exactly as-is.
type RawOrigExpr struct {
return fn
}
-// Before type-checking, bytes.Buffer is a SelectorExpr.
-// After type-checking it becomes a Name.
-func (*SelectorExpr) CanBeNtype() {}
-
// A SliceExpr is a slice expression X[Low:High] or X[Low:High:Max].
type SliceExpr struct {
miniExpr
func (n *StarExpr) Implicit() bool { return n.flags&miniExprImplicit != 0 }
func (n *StarExpr) SetImplicit(b bool) { n.flags.set(miniExprImplicit, b) }
-func (*StarExpr) CanBeNtype() {}
-
-// SetOTYPE changes n to be an OTYPE node returning t,
-// like all the type nodes in type.go.
-func (n *StarExpr) SetOTYPE(t *types.Type) {
- n.op = OTYPE
- n.X = nil
- n.typ = t
- t.SetNod(n)
-}
-
// A TypeAssertionExpr is a selector expression X.(Type).
// Before type-checking, the type is Ntype.
type TypeAssertExpr struct {
n.SetType(nil)
return n
}
+
+ // TODO(mdempsky): Remove (along with ctxType above) once I'm
+ // confident this code path isn't needed any more.
if l.Op() == ir.OTYPE {
- n.SetOTYPE(types.NewPtr(l.Type()))
- // Ensure l.Type gets CalcSize'd for the backend. Issue 20174.
- types.CheckSize(l.Type())
- return n
+ base.Fatalf("unexpected type in deref expression: %v", l)
}
if !t.IsPtr() {