File tree Expand file tree Collapse file tree 2 files changed +39
-1
lines changed
compiler/noirc_frontend/src Expand file tree Collapse file tree 2 files changed +39
-1
lines changed Original file line number Diff line number Diff line change @@ -154,7 +154,7 @@ impl Elaborator<'_> {
154154
155155 let function_ids = functions. function_ids ( ) ;
156156
157- if let Type :: DataType ( data_type, _) = & self_type {
157+ if let Type :: DataType ( data_type, _) = & self_type. follow_bindings ( ) {
158158 let data_ref = data_type. borrow ( ) ;
159159
160160 // `impl`s are only allowed on types defined within the current crate
Original file line number Diff line number Diff line change @@ -395,3 +395,41 @@ fn regression_10415_without_alias() {
395395 "# ;
396396 assert_no_errors ( src) ;
397397}
398+
399+ #[ test]
400+ fn regression_10429 ( ) {
401+ let src = r#"
402+ struct Struct {}
403+
404+ type Alias = Struct;
405+
406+ impl Alias {}
407+
408+ fn main() {}
409+ "# ;
410+ assert_no_errors ( src) ;
411+ }
412+
413+ #[ test]
414+ fn regression_10429_with_trait ( ) {
415+ let src = r#"
416+ struct Struct {}
417+
418+ type Alias = Struct;
419+
420+ trait Foo {
421+ fn foo() -> Self;
422+ }
423+
424+ impl Foo for Alias {
425+ fn foo() -> Self {
426+ Struct {}
427+ }
428+ }
429+
430+ fn main() {
431+ let _alias: Alias = <Alias as Foo>::foo();
432+ }
433+ "# ;
434+ assert_no_errors ( src) ;
435+ }
You can’t perform that action at this time.
0 commit comments