question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

What exactly does t.annotate do?

See original GitHub issue

When annotation mode is turned on

This

function printThing(thing: string) {
}

becomes

import t from "flow-runtime";
function printThing(thing) {}
t.annotate(printThing, t.function(t.param("thing", t.string())));

However while I totally understand what warn and assert does, I can’t seem to find any docs on just what t.annotate actually do. Can someone help me point me to the right place to look?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8

github_iconTop GitHub Comments

1reaction
phpnodecommented, Apr 6, 2017
type StringMaker = (id: string) => string;

function makeNumber (id: number): number {
 return id; 
}

const fn: StringMaker = makeNumber; // fails when annotate is on, passes when off.
0reactions
tonyxiaocommented, Apr 6, 2017

Super helpful, thanks so much!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Annotating a Text - Reading and Study Strategies
Annotating is any action that deliberately interacts with a text to enhance the reader's understanding of, recall of, and reaction to the text....
Read more >
How to Annotate | English Composition I
It means to add notes (an-NOTE-tate) to text that you are reading, to offer explanation, comments or opinions to the author's words.
Read more >
Is Annotating Necessary? Five Reasons Why - David Rickert
3. It gives you something to say. ... Annotation prepares students with something meaningful to say in class. When I do online discussions...
Read more >
What annotating is NOT: - Shaker Heights Schools
What annotating is NOT: Many students think that annotation consists of merely highlighting and​/​or underlining passages​. ​Nope. By definition, ​to annotat​e ...
Read more >
To Annotate or Not to Annotate [Discussion] #LetsTalkBookish ...
Annotation is simply interacting with the text to find meaning as you read. What is the difference between Annotation, Highlighting, and Note- ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found