Skip to content

Commit

Permalink
recycle tyOptDeprecated => tyAliasSym
Browse files Browse the repository at this point in the history
  • Loading branch information
timotheecour committed Jun 22, 2020
1 parent 92e0046 commit 4273f45
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 18 deletions.
12 changes: 4 additions & 8 deletions compiler/ast.nim
Original file line number Diff line number Diff line change
Expand Up @@ -434,19 +434,15 @@ type
# instantiation and prior to this it has the potential to
# be any type.

tyOptDeprecated
# deadcode: was `tyOpt`, Builtin optional type

tyAliasSym
tyVoid
# now different from tyEmpty, hurray!

tyAliasSym

static:
when false:
assert TTypeKind.high.ord <= 63
# remind us when TTypeKind stops to fit in a single 64-bit word
assert TTypeKind.high.ord <= 63
# consider merging some types if profiling shows a slowdown
# consider merging some types if profiling shows a slowdown (though it's
# unlikely)

const
tyPureObject* = tyTuple
Expand Down
1 change: 0 additions & 1 deletion compiler/jsgen.nim
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,6 @@ proc mapType(typ: PType): TJSTypeKind =
else: result = etyNone
of tyProc: result = etyProc
of tyCString: result = etyString
of tyOptDeprecated: doAssert false

proc mapType(p: PProc; typ: PType): TJSTypeKind =
result = mapType(typ)
Expand Down
1 change: 0 additions & 1 deletion compiler/liftdestructors.nim
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,6 @@ proc fillBody(c: var TLiftCtx; t: PType; body, x, y: PNode) =
of tyOrdinal, tyRange, tyInferred,
tyGenericInst, tyAlias, tySink:
fillBody(c, lastSon(t), body, x, y)
of tyOptDeprecated: doAssert false

proc produceSymDistinctType(g: ModuleGraph; c: PContext; typ: PType;
kind: TTypeAttachedOp; info: TLineInfo): PSym =
Expand Down
6 changes: 2 additions & 4 deletions compiler/types.nim
Original file line number Diff line number Diff line change
Expand Up @@ -438,8 +438,8 @@ const
"lent ", "varargs[$1]", "UncheckedArray[$1]", "Error Type",
"BuiltInTypeClass", "UserTypeClass",
"UserTypeClassInst", "CompositeTypeClass", "inferred",
"and", "or", "not", "any", "static", "TypeFromExpr", "FieldAccessor",
"void", "aliasSym"]
"and", "or", "not", "any", "static", "TypeFromExpr", "aliasSym",
"void"]

const preferToResolveSymbols = {preferName, preferTypeName, preferModuleInfo,
preferGenericArg, preferResolved, preferMixed}
Expand Down Expand Up @@ -1177,7 +1177,6 @@ proc sameTypeAux(x, y: PType, c: var TSameTypeClosure): bool =
cycleCheck()
result = sameTypeAux(a.lastSon, b.lastSon, c)
of tyNone: result = false
of tyOptDeprecated: doAssert false

proc sameBackendType*(x, y: PType): bool =
var c = initSameTypeClosure()
Expand Down Expand Up @@ -1415,7 +1414,6 @@ proc typeAllowedAux(marker: var IntSet, typ: PType, kind: TSymKind,
result = typeAllowedAux(marker, t.lastSon, kind, flags+{taHeap})
else:
result = t
of tyOptDeprecated: doAssert false

proc typeAllowed*(t: PType, kind: TSymKind; flags: TTypeAllowedFlags = {}): PType =
# returns 'nil' on success and otherwise the part of the type that is
Expand Down
1 change: 0 additions & 1 deletion compiler/vmdeps.nim
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,6 @@ proc mapTypeToAstX(cache: IdentCache; t: PType; info: TLineInfo;
if t.n != nil:
result.add t.n.copyTree
of tyOwned: result = mapTypeToBracket("owned", mBuiltinType, t, info)
of tyOptDeprecated: doAssert false

proc opMapTypeToAst*(cache: IdentCache; t: PType; info: TLineInfo): PNode =
result = mapTypeToAstX(cache, t, info, inst=false, allowRecursionX=true)
Expand Down
2 changes: 1 addition & 1 deletion lib/core/macros.nim
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ type
ntyError,
ntyBuiltinTypeClass, ntyUserTypeClass, ntyUserTypeClassInst,
ntyCompositeTypeClass, ntyInferred, ntyAnd, ntyOr, ntyNot,
ntyAnything, ntyStatic, ntyFromExpr, ntyOptDeprecated, ntyVoid
ntyAnything, ntyStatic, ntyFromExpr, ntyAliasSym, ntyVoid

TNimTypeKinds* {.deprecated.} = set[NimTypeKind]
NimSymKind* = enum
Expand Down
3 changes: 1 addition & 2 deletions lib/system/hti.nim
Original file line number Diff line number Diff line change
Expand Up @@ -69,9 +69,8 @@ type
tyAnythingHidden,
tyStaticHidden,
tyFromExprHidden,
tyOptDeprecated,
tyVoidHidden,
tyAliasSym,
tyVoidHidden,

TNimNodeKind = enum nkNone, nkSlot, nkList, nkCase
TNimNode {.compilerproc.} = object
Expand Down

0 comments on commit 4273f45

Please sign in to comment.