feat(tpc): 禁止类型联合 T1 | T2 并优化错误提示
四类类型注解入口统一调用 RejectTypeUnion:任意 T1 | T2 直接报错,报文含行号与 CPtr[T]/rawptr[T]、const/volatile/static/export/extern 替代写法;仅保留内建修饰标记与类型的组合。
This commit is contained in:
1 parent
f19d25782f
commit
3269775945
5 files changed
+54
-4
No files matched your search
@@ -10,7 +10,7 @@ import llvmlite.ir as ir
|
||||
from lib.core import TypeSystem
|
||||
from lib.core.TypeSystem import CTypeRegistry
|
||||
from lib.core.SymbolUtils import (
|
||||
IsListAnnotation, AnnotationContainsName, IsCPtrSubscriptNode, IsCPtrNode,
|
||||
IsListAnnotation, AnnotationContainsName, RejectTypeUnion, IsCPtrSubscriptNode, IsCPtrNode,
|
||||
IsRawPtrSubscriptNode, IsPtrSubscriptNode, ResolveGenericTypeArgStr,
|
||||
EnumClassIntWidth, ClassHasFuncLevelCVTable)
|
||||
|
||||
@@ -1187,6 +1187,8 @@ class DeclarationGenerator:
|
||||
if annotation is None:
|
||||
return 'i8*'
|
||||
|
||||
RejectTypeUnion(annotation)
|
||||
|
||||
non_struct_types: set[str] = {'list', 'dict', 'tuple', 'set', 'array', 'CArray', 'rawarray'}
|
||||
|
||||
if isinstance(annotation, ast.Name):
|
||||
|
||||
Reference in new issue
Block a user