Comments (5)
The part I am not following is when these code patterns do emit an ambiguity error.
This does it:
record r { } proc r.test() { var foo: int; proc r.foo { } foo; }
Right. If it were proc foo
then I would think it should be a redeclaration error; otherwise ambiguity. (But I wouldn't view a redeclaration error in this case as particularly bothersome; just conceptually it should be an ambiguity error because proc r.foo
is adding something within record r
which isn't in the same scope as var foo
.
Except I'm realizing now that #25231 unintentionally changed this from an ambiguity error to a redeclaration error. I thought about that and had meant to avoid it, but I also don't know if it matters too much either way.
IMO it'd be reasonable to make an issue about the deficiency and move on to the next thing.
from chapel.
@riftEmber I'm not seeing that this is a dyno bug. On main
with chpl
, I am not seeing an ambiguity error in this case:
proc test(foo: int) {
var foo: int; // this does not trigger an ambiguity error
return foo;
}
var x = test(1);
writeln(x);
I think that we view the formals to be in a scope just outside of the function body. So var foo
in this case is closer than the formal foo: int
.
The part I am not following is when these code patterns do emit an ambiguity error.
from chapel.
Right. If it were proc foo then I would think it should be a redeclaration error; otherwise ambiguity. (But I wouldn't view a redeclaration error in this case as particularly bothersome; just conceptually it should be an ambiguity error because proc r.foo is adding something within record r which isn't in the same scope as var foo.
Okay, that makes sense.
IMO it'd be reasonable to make an issue about the deficiency and move on to the next thing.
Since I'm already warmed up on this I figured it would take about the same amount of time to just fix it as to make an issue, so I did: #25407
from chapel.
I'm not seeing that this is a dyno bug. On main with chpl, I am not seeing an ambiguity error in this case
I think that we view the formals to be in a scope just outside of the function body
Oh, whoops. I guess it's fine then.
The part I am not following is when these code patterns do emit an ambiguity error.
This does it:
record r { }
proc r.test() {
var foo: int;
proc r.foo { }
foo;
}
Except I'm realizing now that #25231 unintentionally changed this from an ambiguity error to a redeclaration error. I thought about that and had meant to avoid it, but I also don't know if it matters too much either way.
from chapel.
Closing as not a bug
from chapel.
Related Issues (20)
- [Feature Request]: Add Ordered Dictionary to Standard Modules.
- [Feature Request]: Add pragma for `writeln` arguments having spaces? HOT 3
- [Bug]: Current `domain.shape` definition causing GPU issues (and is slower?) HOT 5
- [Feature Request]: Warning when a data-parallel loop over something distributed is not distributed HOT 3
- Missing unstable warning on `cyclicDist.createArray` with `initExpr` HOT 5
- [Performance]: Fall back to looping for small bulk array transfers (potentially via AVE machinery)
- Enabling `proc sort` on distributed arrays HOT 6
- Support array view elision in distributed arrays
- [Feature Request]: Type highlighting for chpl-language-server HOT 1
- Making expression level loops more consistent
- [Bug]: strange behavior in zippered loop expressions with distributed and DR domains HOT 6
- [Bug]: Calling an `extern proc` with an invalid number of arguments results in an internal error HOT 1
- GPU-based reductions with dynamic block sizes don't compile
- [Bug]: surprising memory usage for returning an array with declared return type
- Remove deprecated support for implicit reads/writes of sync variables
- Implement/improve error messages for misuse of `localAccess` HOT 3
- [Bug]: segmentation fault using type-producing function in variable declaration.
- Potentially misleading error message for incomplete generic return types HOT 3
- Segfaults when using AtomicObjects or Regex+IO with `CHPL_ATOMICS=locks`
- Deprecating `CHPL_ATOMICS=locks` HOT 2
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 chapel.