@@ -479,23 +479,33 @@ void Parser::ProcessTriple(
479
479
480
480
if (source.IsElementType () && (connector.GetType () == ScType::ConstPermPosArc))
481
481
{
482
+ if (target.m_type .IsConnector ())
483
+ SC_THROW_EXCEPTION (
484
+ utils::ExceptionParseError,
485
+ " Connector with type `" << std::string (target.m_type )
486
+ << " ` can't belong to sc-element denoting type of sc-elements `" << source.GetIdtf ()
487
+ << " `." );
488
+
482
489
std::string const & sourceIdtf = source.GetIdtf ();
483
490
ScType const newType = target.m_type | scs::TypeResolver::GetKeynodeType (sourceIdtf);
484
491
485
492
if (target.IsElementType () && !newType.CanExtendTo (ScType::ConstNodeClass))
486
493
SC_THROW_EXCEPTION (
487
494
utils::ExceptionParseError,
488
495
" Can't extend type `" << std::string (target.m_type ) << " ` to type `" << std::string (newType)
489
- << " ` for element `" << target.GetIdtf () << " `, because element `" << target.GetIdtf ()
490
- << " ` is element denoting type of sc-elements." );
496
+ << " ` for sc- element `" << target.GetIdtf () << " `, because sc- element `" << target.GetIdtf ()
497
+ << " ` is sc- element denoting type of sc-elements." );
491
498
else if (target.m_type .CanExtendTo (newType))
492
499
target.m_type = newType;
493
500
else
501
+ {
502
+ std::cout << newType << std::endl;
494
503
SC_THROW_EXCEPTION (
495
504
utils::ExceptionParseError,
496
505
" Can't extend type `" << std::string (target.m_type ) << " ` to type `" << std::string (newType)
497
- << " ` for element `" << target.GetIdtf () << " `, because `" << std::string (newType)
506
+ << " ` for sc- element `" << target.GetIdtf () << " `, because `" << std::string (newType)
498
507
<< " ` is not subtype of `" << std::string (target.m_type ) << " `." );
508
+ }
499
509
500
510
// TODO(NikitaZotov): Unfortunately, parser collects all sc.s-elements, and only then forms sc.s-triples based on
501
511
// the parsed sc.s-elements. Due to this, it is difficult to handle cases when it is necessary not to generate a
0 commit comments