Module: Steep::Diagnostic::Signature
- Defined in:
- lib/steep/diagnostic/signature.rb
Defined Under Namespace
Classes: Base, ClassVariableDuplicationError, CyclicClassAliasDefinitionError, DuplicatedDeclaration, DuplicatedMethodDefinition, GenericParameterMismatch, InconsistentClassModuleAliasError, InheritModuleError, InstanceVariableTypeError, InvalidMethodOverload, InvalidTypeApplication, InvalidVarianceAnnotation, MixinClassError, ModuleSelfTypeError, NonregularTypeAlias, RecursiveAlias, RecursiveAncestor, RecursiveTypeAlias, SuperclassMismatch, SyntaxError, TypeParamDefaultReferenceError, UnexpectedError, UnknownMethodAlias, UnknownTypeName, UnsatisfiableGenericsDefaultType, UnsatisfiableTypeApplication
Class Method Summary collapse
Class Method Details
.from_rbs_error(error, factory:) ⇒ Object
464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 |
# File 'lib/steep/diagnostic/signature.rb', line 464 def self.from_rbs_error(error, factory:) case error when RBS::ParsingError Diagnostic::Signature::SyntaxError.new(error, location: error.location) when RBS::DuplicatedDeclarationError Diagnostic::Signature::DuplicatedDeclaration.new( type_name: error.name, location: error.decls.fetch(0).location ) when RBS::GenericParameterMismatchError Diagnostic::Signature::GenericParameterMismatch.new( name: error.name, location: error.decl.location ) when RBS::InvalidTypeApplicationError Diagnostic::Signature::InvalidTypeApplication.new( name: error.type_name, args: error.args.map {|ty| factory.type(ty) }, params: error.params, location: error.location ) when RBS::NoTypeFoundError, RBS::NoSuperclassFoundError, RBS::NoMixinFoundError, RBS::NoSelfTypeFoundError Diagnostic::Signature::UnknownTypeName.new( name: error.type_name, location: error.location ) when RBS::InvalidOverloadMethodError Diagnostic::Signature::InvalidMethodOverload.new( class_name: error.type_name, method_name: error.method_name, location: error.members.fetch(0).location ) when RBS::DuplicatedMethodDefinitionError Diagnostic::Signature::DuplicatedMethodDefinition.new( class_name: error.type_name, method_name: error.method_name, location: error.location ) when RBS::DuplicatedInterfaceMethodDefinitionError Diagnostic::Signature::DuplicatedMethodDefinition.new( class_name: error.type_name, method_name: error.method_name, location: error.member.location ) when RBS::UnknownMethodAliasError Diagnostic::Signature::UnknownMethodAlias.new( class_name: error.type_name, method_name: error.original_name, location: error.location ) when RBS::RecursiveAliasDefinitionError Diagnostic::Signature::RecursiveAlias.new( class_name: error.type.name, names: error.defs.map(&:name), location: error.defs.fetch(0).original&.location ) when RBS::RecursiveAncestorError Diagnostic::Signature::RecursiveAncestor.new( ancestors: error.ancestors, location: error.location ) when RBS::SuperclassMismatchError Diagnostic::Signature::SuperclassMismatch.new( name: error.name, location: error.entry.primary.decl.location ) when RBS::InvalidVarianceAnnotationError Diagnostic::Signature::InvalidVarianceAnnotation.new( name: error.type_name, param: error.param, location: error.location ) when RBS::MixinClassError Diagnostic::Signature::MixinClassError.new( location: error.location, type_name: error.type_name, member: error.member, ) when RBS::RecursiveTypeAliasError Diagnostic::Signature::RecursiveTypeAlias.new( alias_names: error.alias_names, location: error.location ) when RBS::NonregularTypeAliasError Diagnostic::Signature::NonregularTypeAlias.new( type_name: error.diagnostic.type_name, nonregular_type: factory.type(error.diagnostic.nonregular_type), location: error.location ) when RBS::InheritModuleError Diagnostic::Signature::InheritModuleError.new(error.super_decl) when RBS::InconsistentClassModuleAliasError Diagnostic::Signature::InconsistentClassModuleAliasError.new(decl: error.alias_entry.decl) when RBS::CyclicClassAliasDefinitionError Diagnostic::Signature::CyclicClassAliasDefinitionError.new(decl: error.alias_entry.decl) when RBS::TypeParamDefaultReferenceError Diagnostic::Signature::TypeParamDefaultReferenceError.new(error.type_param, location: error.location) else raise error end end |