diff options
author | John Hodge <tpg@mutabah.net> | 2016-09-28 13:58:27 +0800 |
---|---|---|
committer | John Hodge <tpg@mutabah.net> | 2016-09-28 13:58:27 +0800 |
commit | bd2deb32914952f835077fb275d282839cec2d96 (patch) | |
tree | 39d2131f3f88252cd76ecdf1bea92b56a5d00a37 /src/resolve/absolute.cpp | |
parent | 4edbe2df00354b257389e485dda544eb30a62409 (diff) | |
download | mrust-bd2deb32914952f835077fb275d282839cec2d96.tar.gz |
Resolve Absolute - Array patterns can be irrefutable
Diffstat (limited to 'src/resolve/absolute.cpp')
-rw-r--r-- | src/resolve/absolute.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/resolve/absolute.cpp b/src/resolve/absolute.cpp index 4efad8c9..e5576fc8 100644 --- a/src/resolve/absolute.cpp +++ b/src/resolve/absolute.cpp @@ -1670,7 +1670,7 @@ void Resolve_Absolute_Pattern(Context& context, bool allow_refutable, ::AST::Pa ), (Value, if( ! allow_refutable ) - BUG(pat.span(), "Resolve_Absolute_Pattern - Enountered refutable pattern where only irrefutable allowed"); + BUG(pat.span(), "Resolve_Absolute_Pattern - Encountered refutable pattern where only irrefutable allowed - " << pat); Resolve_Absolute_PatternValue(context, pat.span(), e.start); Resolve_Absolute_PatternValue(context, pat.span(), e.end); ), @@ -1693,8 +1693,7 @@ void Resolve_Absolute_Pattern(Context& context, bool allow_refutable, ::AST::Pa Resolve_Absolute_Pattern(context, allow_refutable, sp.second); ), (Slice, - if( !allow_refutable ) - BUG(pat.span(), "Resolve_Absolute_Pattern - Enountered refutable pattern where only irrefutable allowed"); + // NOTE: Can be irrefutable (if the type is array) for(auto& sp : e.leading) Resolve_Absolute_Pattern(context, allow_refutable, sp); if( e.extra_bind != "" && e.extra_bind != "_" ) { |