Skip to content

Commit

Permalink
Rename
Browse files Browse the repository at this point in the history
  • Loading branch information
DQNEO committed Aug 20, 2023
1 parent 8e1170a commit 4bb0221
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions internal/sema/sema.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func prepareArgsAndParams(paramTypes []types.Type, receiver ir.MetaExpr, eArgs [
if argIndex < lenParams {
paramType = paramTypes[argIndex]
slc, isSlice := paramType.(*types.Slice)
if isSlice && slc.IsEllip {
if isSlice && slc.IsElps {
variadicElmType = slc.Elem()
variadicArgs = make([]ast.Expr, 0, 20)
}
Expand Down Expand Up @@ -144,7 +144,7 @@ func prepareArgsAndParams(paramTypes []types.Type, receiver ir.MetaExpr, eArgs [
// Add nil as a variadic arg
p := paramTypes[len(metaArgs)]
elp := p.(*types.Slice)
assert(elp.IsEllip, "should be Ellipsis", __func__)
assert(elp.IsElps, "should be Ellipsis", __func__)
paramType := types.NewSlice(elp.Elem())
iNil := &ast.Ident{
Obj: universe.Nil,
Expand Down Expand Up @@ -385,7 +385,7 @@ func E2T(typeExpr ast.Expr) types.Type {
return types.NewPointer(E2T(t.X))
case *ast.Ellipsis:
slc := types.NewSlice(E2T(t.Elt))
slc.IsEllip = true
slc.IsElps = true
return slc
case *ast.MapType:
return types.NewMap(E2T(t.Key), E2T(t.Value))
Expand Down Expand Up @@ -2464,7 +2464,7 @@ func SerializeType(goType types.Type, showOnlyForeignPrefix bool, currentPkgName
case *types.Array:
return "[" + strconv.Itoa(g.Len()) + "]" + SerializeType(g.Elem(), showOnlyForeignPrefix, currentPkgName)
case *types.Slice:
if g.IsEllip {
if g.IsElps {
return "..." + SerializeType(g.Elem(), showOnlyForeignPrefix, currentPkgName)
} else {
return "[]" + SerializeType(g.Elem(), showOnlyForeignPrefix, currentPkgName)
Expand Down
4 changes: 2 additions & 2 deletions internal/types/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ func (t *Array) Underlying() Type { return t }
func (t *Array) String() string { return "@TBI" }

type Slice struct {
elem Type
IsEllip bool
elem Type
IsElps bool
}

// NewSlice returns a new slice type for the given element type.
Expand Down

0 comments on commit 4bb0221

Please sign in to comment.