Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Generic type can't be inferred through lambda block #1471

Closed
brson opened this issue Jan 9, 2012 · 2 comments
Closed

Generic type can't be inferred through lambda block #1471

brson opened this issue Jan 9, 2012 · 2 comments
Labels
A-type-system Area: Type system

Comments

@brson
Copy link
Contributor

brson commented Jan 9, 2012

type actor<T> = {                                                                                                                                              
    unused: bool                                                                                                                                               
};                                                                                                                                                             

type self<T> = {                                                                                                                                               
    unused: bool                                                                                                                                               
};                                                                                                                                                             

fn act<T:send>(+behavior: sendfn(self<T>)) -> actor<T> {                                                                                                       
    {unused: true}                                                                                                                                             
}                                                                                                                                                              

tag in {                                                                                                                                                       
    preprocess([u8]);                                                                                                                                          
    exit;                                                                                                                                                      
}                                                                                                                                                              

fn mk() -> actor<in> {                                                                                                                                         
    act {|self|                                                                                                                                                
    }                                                                                                                                                          
}                                                                                                                                                              

fn main() {                                                                                                                                                    
}
../src/test/run-pass/block-infer.rs:19:4: 19:7 error: cannot determine a type for this expression
../src/test/run-pass/block-infer.rs:19     act {|self|

Writing act::<in> allows it to work.

@brson
Copy link
Contributor Author

brson commented Jan 9, 2012

Writing act::<in> {|self: self<in>| doesn't work either.

@brson
Copy link
Contributor Author

brson commented Feb 6, 2012

This doesn't have to do with lambda blocks at all. The following also doesn't work:

type actor<T> = {                                                                                                                                                             
    unused: bool                                                                                                                                                              
};                                                                                                                                                                            

fn act2<T:send>() -> actor<T> {                                                                                                                                               
}                                                                                                                                                                             

enum in {                                                                                                                                                                     
    preprocess([u8]),                                                                                                                                                         
    exit                                                                                                                                                                      
}                                                                                                                                                                             

fn mk() -> actor<in> {                                                                                                                                                        
    act2()                                                                                                                                                                    
}                                                                                                                                                                             

fn main() {                                                                                                                                                                   
}                                                                                                                                                                             

@brson brson closed this as completed Feb 6, 2012
joshtriplett added a commit to joshtriplett/rust that referenced this issue Oct 7, 2022
- .gitattributes: Mark minified javascript as binary to filter greps
- fix very minor punctuation typo
- diagnostic structs: derive on enum (rust-lang#1477)
- Update running tests with the new flags (rust-lang#1476)
- Rename typeck to hir_analysis (rust-lang#1475)
- fix typo and make paragraph consistent (rust-lang#1474)
- Update about-this-guide.md
- Link to the correct page in "about this guide"
- Update r-a config suggestions
- don't refer to the compile-time interpreter as "Miri" (rust-lang#1471)
- UPDATE - Diagnostic docs to reflect renamed traits and macros in rustc PR#101558
- Update mdbook and its extensions versions
- Remove unmaintained action
- Update some actions versions
- Fix some typos

Update motivated in large part by the most recent commit, to fix `git
grep`.
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this issue Oct 8, 2022
… r=ehuss

Update rustc-dev-guide

- .gitattributes: Mark minified javascript as binary to filter greps
- fix very minor punctuation typo
- diagnostic structs: derive on enum (rust-lang#1477)
- Update running tests with the new flags (rust-lang#1476)
- Rename typeck to hir_analysis (rust-lang#1475)
- fix typo and make paragraph consistent (rust-lang#1474)
- Update about-this-guide.md
- Link to the correct page in "about this guide"
- Update r-a config suggestions
- don't refer to the compile-time interpreter as "Miri" (rust-lang#1471)
- UPDATE - Diagnostic docs to reflect renamed traits and macros in rustc PR#101558
- Update mdbook and its extensions versions
- Remove unmaintained action
- Update some actions versions
- Fix some typos

Update motivated in large part by the most recent commit, to fix `git
grep`.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Oct 8, 2022
… r=ehuss

Update rustc-dev-guide

- .gitattributes: Mark minified javascript as binary to filter greps
- fix very minor punctuation typo
- diagnostic structs: derive on enum (rust-lang#1477)
- Update running tests with the new flags (rust-lang#1476)
- Rename typeck to hir_analysis (rust-lang#1475)
- fix typo and make paragraph consistent (rust-lang#1474)
- Update about-this-guide.md
- Link to the correct page in "about this guide"
- Update r-a config suggestions
- don't refer to the compile-time interpreter as "Miri" (rust-lang#1471)
- UPDATE - Diagnostic docs to reflect renamed traits and macros in rustc PR#101558
- Update mdbook and its extensions versions
- Remove unmaintained action
- Update some actions versions
- Fix some typos

Update motivated in large part by the most recent commit, to fix `git
grep`.
Dylan-DPC added a commit to Dylan-DPC/rust that referenced this issue Oct 8, 2022
… r=ehuss

Update rustc-dev-guide

- .gitattributes: Mark minified javascript as binary to filter greps
- fix very minor punctuation typo
- diagnostic structs: derive on enum (rust-lang#1477)
- Update running tests with the new flags (rust-lang#1476)
- Rename typeck to hir_analysis (rust-lang#1475)
- fix typo and make paragraph consistent (rust-lang#1474)
- Update about-this-guide.md
- Link to the correct page in "about this guide"
- Update r-a config suggestions
- don't refer to the compile-time interpreter as "Miri" (rust-lang#1471)
- UPDATE - Diagnostic docs to reflect renamed traits and macros in rustc PR#101558
- Update mdbook and its extensions versions
- Remove unmaintained action
- Update some actions versions
- Fix some typos

Update motivated in large part by the most recent commit, to fix `git
grep`.
matthiaskrgr added a commit to matthiaskrgr/rust that referenced this issue Oct 8, 2022
… r=ehuss

Update rustc-dev-guide

- .gitattributes: Mark minified javascript as binary to filter greps
- fix very minor punctuation typo
- diagnostic structs: derive on enum (rust-lang#1477)
- Update running tests with the new flags (rust-lang#1476)
- Rename typeck to hir_analysis (rust-lang#1475)
- fix typo and make paragraph consistent (rust-lang#1474)
- Update about-this-guide.md
- Link to the correct page in "about this guide"
- Update r-a config suggestions
- don't refer to the compile-time interpreter as "Miri" (rust-lang#1471)
- UPDATE - Diagnostic docs to reflect renamed traits and macros in rustc PR#101558
- Update mdbook and its extensions versions
- Remove unmaintained action
- Update some actions versions
- Fix some typos

Update motivated in large part by the most recent commit, to fix `git
grep`.
celinval pushed a commit to celinval/rust-dev that referenced this issue Jun 4, 2024
bors pushed a commit to rust-lang-ci/rust that referenced this issue Jan 2, 2025
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
A-type-system Area: Type system
Projects
None yet
Development

No branches or pull requests

1 participant