File tree Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Expand file tree Collapse file tree 2 files changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -1601,4 +1601,31 @@ function \"+\"(a : integer; b : character) return integer;
16011601 ) )
16021602 ) ;
16031603 }
1604+
1605+ #[ test]
1606+ fn universal_integer_target_type_accepts_integer ( ) {
1607+ let test = TestSetup :: new ( ) ;
1608+ test. declarative_part (
1609+ "
1610+ function no_arg return boolean;
1611+ function no_arg return integer;
1612+ function with_arg(arg : natural) return boolean;
1613+ function with_arg(arg : natural) return integer;
1614+
1615+ " ,
1616+ ) ;
1617+
1618+ let code = test. snippet ( "no_arg" ) ;
1619+ test. expr_with_ttyp (
1620+ & code,
1621+ test. ctx ( ) . universal_integer ( ) . into ( ) ,
1622+ & mut NoDiagnostics ,
1623+ ) ;
1624+ let code = test. snippet ( "with_arg(0)" ) ;
1625+ test. expr_with_ttyp (
1626+ & code,
1627+ test. ctx ( ) . universal_integer ( ) . into ( ) ,
1628+ & mut NoDiagnostics ,
1629+ ) ;
1630+ }
16041631}
Original file line number Diff line number Diff line change @@ -319,7 +319,7 @@ impl<'a> AnalyzeContext<'a> {
319319
320320 let ok_return_type = if let SubprogramKind :: Function ( rtyp) = kind {
321321 let mut ok_return_type = ok_assoc_types. clone ( ) ;
322- self . implicit_matcher ( )
322+ self . any_matcher ( )
323323 . disambiguate_op_by_return_type ( & mut ok_return_type, rtyp) ;
324324
325325 // Only one candidate matches type profile, check it
You can’t perform that action at this time.
0 commit comments