type.isLiteral() returns false for boolean literals
#26.075 aberto em 31 de jul. de 2018
Métricas do repositório
- Stars
- (48.455 stars)
- Métricas de merge de PR
- (Mesclagem média 6d 17h) (9 fundiu PRs em 30d)
Description
TypeScript Version: 3.1.0-dev.20180728 (new in 3.0.1)
Search Terms: isLiteral()
Code
- Create a boolean literal in the compiler api.
- Call
isLiteral()on it.
Change seems to be done here:
Expected behavior: true for a boolean literal type (true or false)
Actual behavior: false
I have a few tests for assumptions about the compiler api in ts-simple-ast and this one started failing. Maybe it's not a bug, but I thought I would log it anyway to find out why this behaviour changed.
Is it because it doesn't have the Unit flag while string and number literals do? For what it's worth, in checker.ts it will internally return true for boolean literals in isLiteralType.