Comments (7)
I went back in time using the following CLI commands
(Note: modular clean removes the entire install of MAX/serving/mojo)
modular clean
modular install nightly/mojo --install-version
and found that this bug does not exist in 2024.6.2305 but does exist in 2024.6.2505.
Additionally, there is some odd - to me as I am truly a rookie with extra time on his hands - behavior. If someone could shed light on the following, I would greatly appreciate it.
As expected:
In 2024.6.2305 through to today (Note use of var
)
fn main():
var l = List[Int](1, 2, 3)
print(l[0]) # prints 0
In 2024.6.2305 alias
behaves as expected
fn main():
alias l = List[Int](1, 2, 3)
print(l[0]) # prints 1
However, in 2024.6.2505
fn main():
alias l = List[Int](1, 2, 3)
print(l[0]) # prints 0
from mojo.
There is some history of compile time issues as collections switched to returning references. But there is at least one use of alias List in the stdlib so that problem seems to have been solved or occurs much more narrowly than in previous implementations.
If this is a recent breakage as mentioned above then it is probably this commit. My PR (#2847 ) was merged afterward just for the changes to tests if I understood the comment there correctly.
from mojo.
I think we need way more "compile time tests" because those regressions/bugs are really frequent. Not many structs are currently tested at both compile-time and runtime. This could be a very good "good first issue".
from mojo.
Is this a dup of #3098?
@ematejska I don't think so. #3098 likely has something to do with Tensor
and not List
.
from mojo.
@DWSimmons Thanks for the detailed analysis here. Looks like a regression. Still reproduces in mojo 2024.7.905 (e860c551)
from mojo.
Possibly related to #2847 ?
from mojo.
Is this a dup of #3098?
from mojo.
Related Issues (20)
- [BUG] Can't form alias to `Int`'s dunder methods HOT 6
- [BUG] repr syntax sugar not working using conditional conformance HOT 2
- [BUG] SIMD[type,size].MAX_FINITE HOT 2
- [BUG] UnsafePointer inside function gets freed too early depending on branch (lifetime issue, eager destruction) HOT 6
- [BUG] `SIMD.store/load` for `DType.bool`
- [BUG] running Mojo code with run ownership parameter causes crash on Mac without LLVM installed HOT 2
- [Feature Request] [LSP] [docstrings] Better Markdown support for arbitrary section headers, correct `<ul>` rendering, and standardization of section ordering
- [BUG] Difference between __getitem__ and [.] operator
- [BUG] Parser crash when trying to annotate alias `2**2` with `IntLiteral` HOT 2
- [Feature Request] Decorator to control implicit conformance to trait
- [BUG] __gt__ error in Matrix structure
- [BUG] UInt32 or UInt64 conversion to Float32 or Float64 does not work correctly HOT 1
- [Modular CLI] modular update mojo ends up in a segmentation fault HOT 1
- [Feature Request] [stdlib] [proposal] Unicode Indexing for `String` and buffer idx for `StringSlice` in `__getitem__` and `__setitem__`
- [BUG] Get segmentation fault when build mojo and run it but don't get segmentation fault when run directly with mojo
- [BUG] stack_allocation fails HOT 1
- [Feature Request] Where clause alternative: "Composite Traits" `TraitVariant` (`|`) and `TraitUnion` (`&`)
- [BUG] Numpy imported into Mojo has inconsistent benchmarking results
- [Feature Request] Add benchmark for `Dict` and explore swiss table algorithm with SIMD probing
- [Docs]
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mojo.