@@ -51,21 +51,21 @@ impl Default for TypedDictParams {
5151pub enum TypedDictType < ' db > {
5252 /// A reference to the class (inheriting from `typing.TypedDict`) that specifies the
5353 /// schema of this `TypedDict`.
54- FromClass ( ClassType < ' db > ) ,
54+ ClassBased ( ClassType < ' db > ) ,
5555
5656 /// A `TypedDict` created using the functional syntax.
57- Synthesized ( SynthesizedTypedDictType < ' db > ) ,
57+ Functional ( FunctionalTypedDictType < ' db > ) ,
5858}
5959
6060impl < ' db > TypedDictType < ' db > {
6161 pub ( crate ) fn from_class ( class : ClassType < ' db > ) -> Self {
62- TypedDictType :: FromClass ( class)
62+ TypedDictType :: ClassBased ( class)
6363 }
6464
6565 pub ( crate ) fn items ( & self , db : & ' db dyn Db ) -> Cow < ' db , FxOrderMap < Name , Field < ' db > > > {
6666 match self {
67- TypedDictType :: Synthesized ( synthesized ) => Cow :: Borrowed ( synthesized . items ( db) ) ,
68- TypedDictType :: FromClass ( class) => {
67+ TypedDictType :: Functional ( functional ) => Cow :: Borrowed ( functional . items ( db) ) ,
68+ TypedDictType :: ClassBased ( class) => {
6969 let ( class_literal, specialization) = class. class_literal ( db) ;
7070 Cow :: Owned ( class_literal. fields ( db, specialization, CodeGeneratorKind :: TypedDict ) )
7171 }
@@ -77,8 +77,8 @@ impl<'db> TypedDictType<'db> {
7777 // `TypedDict` instances are instances of `dict` at runtime, but its important that we
7878 // understand a more specific meta type in order to correctly handle `__getitem__`.
7979 match self {
80- TypedDictType :: FromClass ( class) => SubclassOfType :: from ( db, class) ,
81- TypedDictType :: Synthesized ( _) => KnownClass :: TypedDictFallback . to_class_literal ( db) ,
80+ TypedDictType :: ClassBased ( class) => SubclassOfType :: from ( db, class) ,
81+ TypedDictType :: Functional ( _) => KnownClass :: TypedDictFallback . to_class_literal ( db) ,
8282 }
8383 }
8484
@@ -90,11 +90,11 @@ impl<'db> TypedDictType<'db> {
9090 ) -> Self {
9191 // TODO: Materialization of gradual TypedDicts needs more logic
9292 match self {
93- TypedDictType :: FromClass ( class) => {
94- TypedDictType :: FromClass ( class. apply_type_mapping_impl ( db, type_mapping, visitor) )
93+ TypedDictType :: ClassBased ( class) => {
94+ TypedDictType :: ClassBased ( class. apply_type_mapping_impl ( db, type_mapping, visitor) )
9595 }
96- TypedDictType :: Synthesized ( synthesized ) => TypedDictType :: Synthesized (
97- synthesized . apply_type_mapping_impl ( db, type_mapping, visitor) ,
96+ TypedDictType :: Functional ( functional ) => TypedDictType :: Functional (
97+ functional . apply_type_mapping_impl ( db, type_mapping, visitor) ,
9898 ) ,
9999 }
100100 }
@@ -409,9 +409,9 @@ pub struct TypedDictSchemaField<'db> {
409409 pub ( crate ) is_read_only : bool ,
410410}
411411
412- #[ salsa:: interned( debug, heap_size=SynthesizedTypedDictType :: heap_size) ]
412+ #[ salsa:: interned( debug, heap_size=FunctionalTypedDictType :: heap_size) ]
413413#[ derive( PartialOrd , Ord ) ]
414- pub struct SynthesizedTypedDictType < ' db > {
414+ pub struct FunctionalTypedDictType < ' db > {
415415 pub ( crate ) name : Name ,
416416
417417 pub ( crate ) params : TypedDictParams ,
@@ -421,9 +421,9 @@ pub struct SynthesizedTypedDictType<'db> {
421421}
422422
423423// The Salsa heap is tracked separately.
424- impl get_size2:: GetSize for SynthesizedTypedDictType < ' _ > { }
424+ impl get_size2:: GetSize for FunctionalTypedDictType < ' _ > { }
425425
426- impl < ' db > SynthesizedTypedDictType < ' db > {
426+ impl < ' db > FunctionalTypedDictType < ' db > {
427427 pub ( super ) fn apply_type_mapping_impl < ' a > (
428428 self ,
429429 db : & ' db dyn Db ,
@@ -442,7 +442,7 @@ impl<'db> SynthesizedTypedDictType<'db> {
442442 } )
443443 . collect :: < FxOrderMap < _ , _ > > ( ) ;
444444
445- SynthesizedTypedDictType :: new ( db, self . name ( db) , self . params ( db) , items)
445+ FunctionalTypedDictType :: new ( db, self . name ( db) , self . params ( db) , items)
446446 }
447447
448448 pub ( crate ) fn normalized_impl (
@@ -469,9 +469,9 @@ pub(crate) fn walk_typed_dict_type<'db, V: visitor::TypeVisitor<'db> + ?Sized>(
469469 visitor : & V ,
470470) {
471471 match typed_dict {
472- TypedDictType :: FromClass ( class) => visitor. visit_type ( db, class. into ( ) ) ,
473- TypedDictType :: Synthesized ( synthesized ) => {
474- for ( _, item) in synthesized . items ( db) {
472+ TypedDictType :: ClassBased ( class) => visitor. visit_type ( db, class. into ( ) ) ,
473+ TypedDictType :: Functional ( functional ) => {
474+ for ( _, item) in functional . items ( db) {
475475 visitor. visit_type ( db, item. declared_ty ) ;
476476 }
477477 }
0 commit comments