@@ -1596,9 +1596,13 @@ def connect_value(*, out_path, in_path, src_loc_at):
15961596 try :
15971597 eq = in_value .eq
15981598 except AttributeError :
1599- raise ConnectionError (
1600- f"Cannot connect input member { _format_path (in_path )} because the input "
1601- f"value { in_value !r} does not support assignment" )
1599+ #raise ConnectionError(
1600+ # f"Cannot connect input member {_format_path(in_path)} because the input "
1601+ # f"value {in_value!r} does not support assignment")
1602+ # TODO(amaranth-0.7): remove
1603+ warnings .warn (f"ValueCastable input value { in_value !r} does not support assignment; "
1604+ "this will become an error in Amaranth 0.7" , DeprecationWarning , stacklevel = 2 )
1605+ eq = Value .cast (in_value ).eq
16021606 # The `eq()` method may take a `src_loc_at` argument; provide it if it does.
16031607 if 'src_loc_at' in inspect .signature (eq ).parameters :
16041608 kwargs = {'src_loc_at' : src_loc_at + 1 }
@@ -1607,9 +1611,13 @@ def connect_value(*, out_path, in_path, src_loc_at):
16071611 try :
16081612 connections .append (eq (out_value , ** kwargs ))
16091613 except Exception as e :
1610- raise ConnectionError (
1611- f"Cannot connect input member { _format_path (in_path )} to output member "
1612- f"{ _format_path (out_path )} because assignment failed" ) from e
1614+ #raise ConnectionError(
1615+ # f"Cannot connect input member {_format_path(in_path)} to output member "
1616+ # f"{_format_path(out_path)} because assignment failed") from e
1617+ # TODO(amaranth-0.7): remove
1618+ warnings .warn (f"Assigning to ValueCastable input value { in_value !r} failed; "
1619+ "this will become an error in Amaranth 0.7" , DeprecationWarning , stacklevel = 2 )
1620+ connections .append (Value .cast (in_value ).eq (out_value , src_loc_at = src_loc_at + 1 ))
16131621 def connect_dimensions (dimensions , * , out_path , in_path , src_loc_at ):
16141622 if not dimensions :
16151623 return connect_value (out_path = out_path , in_path = in_path , src_loc_at = src_loc_at )
0 commit comments