Skip to content

Type error when redirecting a file to stdin #2776

New issue

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

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

Already on GitHub? Sign in to your account

Closed
DartBot opened this issue Apr 27, 2012 · 4 comments
Closed

Type error when redirecting a file to stdin #2776

DartBot opened this issue Apr 27, 2012 · 4 comments
Assignees
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-io

Comments

@DartBot
Copy link

DartBot commented Apr 27, 2012

This issue was originally filed by [email protected]


This simple Dart code dies for a type error when a file is redirected to stdin.

// a.dart

import("dart:io");

main() {
  stdin.read();
}

% dart --enable_type_checks a.dart < a.dart
Unhandled exception:
type '_RandomAccessFile@14117cc4' is not a subtype of type 'File' of 'value'.
 0. Function: '[email protected]:_file@14117cc4' url: 'dart:io' line:1302 col:8
 1. Function: '_FileInputStream@14117cc4[email protected]' url: 'dart:io' line:1237 col:11
 2. Function: '::_getStdioInputStream@14117cc4' url: 'dart:io' line:8095 col:14
 3. Function: '::get:stdin' url: 'dart:io' line:8121 col:34
 4. Function: '::main' url: 'file:///home/nya/src/scratch/dart/a.dart' line:3 col:3

Environment:
  Linux Ubuntu 10.04 LTS (Lucid)
  Stable Dart SDK for Linux (rev: 6934)

@dgrove
Copy link
Contributor

dgrove commented May 1, 2012

Added Area-IO, Triaged labels.

@madsager
Copy link
Contributor

madsager commented May 1, 2012

Set owner to @madsager.
Added Started label.

@madsager
Copy link
Contributor

madsager commented May 1, 2012

Added Fixed label.

@kevmoo
Copy link
Member

kevmoo commented May 14, 2014

Removed Area-IO label.
Added Area-Library, Library-IO labels.

@DartBot DartBot added Type-Defect area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-io labels May 14, 2014
dart-bot pushed a commit that referenced this issue Dec 7, 2020
a7e448b2 pub upgrade --major-versions (#2784)
06bcff09 pub upgrade foo, only unlocks foo from pubspec.lock (#2781)
aa20a4bd Usage exceptions no stacktrace (#2776)
14e12bf6 Clarify error message when spawning a subprocess fails (#2763)
5ef0a0e7 Added a pub upgrade --nullsafety mode (#2741)
9cde2406 Fix pub remove --dry-run (#2774)
7426be94 Remove hack now issue has been fixed (#2773)
90a1f776 Limit retries in test to avoid timeout (#2765)
3aa327c7 Stop depending on .packages (#2764)

Change-Id: Ifd8a8402c4628e7278b6fedfd2ca7902004fa6e8
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175241
Auto-Submit: Jonas Jensen <[email protected]>
Reviewed-by: Sigurd Meldgaard <[email protected]>
Commit-Queue: Sigurd Meldgaard <[email protected]>
dart-bot pushed a commit that referenced this issue Dec 8, 2020
This reverts commit 41381e9.

Reason for revert: pub fails on startup if git is not installed; b/175080640

Original change's description:
> Roll pub
>
> a7e448b2 pub upgrade --major-versions (#2784)
> 06bcff09 pub upgrade foo, only unlocks foo from pubspec.lock (#2781)
> aa20a4bd Usage exceptions no stacktrace (#2776)
> 14e12bf6 Clarify error message when spawning a subprocess fails (#2763)
> 5ef0a0e7 Added a pub upgrade --nullsafety mode (#2741)
> 9cde2406 Fix pub remove --dry-run (#2774)
> 7426be94 Remove hack now issue has been fixed (#2773)
> 90a1f776 Limit retries in test to avoid timeout (#2765)
> 3aa327c7 Stop depending on .packages (#2764)
>
> Change-Id: Ifd8a8402c4628e7278b6fedfd2ca7902004fa6e8
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175241
> Auto-Submit: Jonas Jensen <[email protected]>
> Reviewed-by: Sigurd Meldgaard <[email protected]>
> Commit-Queue: Sigurd Meldgaard <[email protected]>

[email protected],[email protected]

Change-Id: I29b20b4a2dc037146dd27c8fe6e6ecce6833e7b6
No-Presubmit: true
No-Tree-Checks: true
No-Try: true
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175303
Reviewed-by: David Morgan <[email protected]>
Commit-Queue: David Morgan <[email protected]>
dart-bot pushed a commit that referenced this issue Dec 9, 2020
This is a reland of 41381e9

Contains one more fix:
8ea96121d fix tryGitCommand

Original change's description:
> Roll pub
>
> a7e448b2 pub upgrade --major-versions (#2784)
> 06bcff09 pub upgrade foo, only unlocks foo from pubspec.lock (#2781)
> aa20a4bd Usage exceptions no stacktrace (#2776)
> 14e12bf6 Clarify error message when spawning a subprocess fails (#2763)
> 5ef0a0e7 Added a pub upgrade --nullsafety mode (#2741)
> 9cde2406 Fix pub remove --dry-run (#2774)
> 7426be94 Remove hack now issue has been fixed (#2773)
> 90a1f776 Limit retries in test to avoid timeout (#2765)
> 3aa327c7 Stop depending on .packages (#2764)
>
> Change-Id: Ifd8a8402c4628e7278b6fedfd2ca7902004fa6e8
> Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175241
> Auto-Submit: Jonas Jensen <[email protected]>
> Reviewed-by: Sigurd Meldgaard <[email protected]>
> Commit-Queue: Sigurd Meldgaard <[email protected]>

Change-Id: Id50e6eca0372860f7087882a5c67141def07031c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/175309
Reviewed-by: Jonas Jensen <[email protected]>
Commit-Queue: Sigurd Meldgaard <[email protected]>
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-core-library SDK core library issues (core, async, ...); use area-vm or area-web for platform specific libraries. library-io
Projects
None yet
Development

No branches or pull requests

4 participants